Home /University Of Sargodha (UOS) /Object Oriented Programming

Subject: Computer Science Time Allowed: 2:30 Hours University of Sargodha BS 2*d Term Examination 2015 Paper: Object Oriented Programming (CMP:2124) Maximum Marks: 60

Subject: Computer Science Time Allowed: 2:30 Hours University of Sargodha BS 2*d Term Examination 2015 Paper: Object Oriented Programming (CMP:2124) Maximum Marks: 60 — page 1

Discussion

Ask a question about this paper, or help someone else with theirs. Answers are emailed to whoever asked.

Your email is only used to send you replies and occasional Ustadni updates. It is never shown publicly.

Log in to post under your name

No questions yet — be the first to ask.

More Object Oriented Programming papers

See all

Paper text

Subject: Computer Science

Time Allowed: 2:30 Hours

University of Sargodha

BS 2*d Term Examination 2015

Paper: Object Oriented Programming (CMP:2124)

Maximum Marks: 60

Note: Objective part is compulsory. Attempt any four questions from subjective part.

ustadni.co

Q.No.1:

Objective Part (Compulsory)

Attempt all parts and each require answer 2 - 3 lines

i:

What is Object-oriented programming?

ii: Explain Encapsulation concept in Object-oriented programming.

iii:

What is an abstract class?

iv:

Write the syntax of class declaration.

V: Which Member functions do not needed to be called by object and why?

V1:

What is the purpose of Destructor?

vil.

Different between method overriding and method overloading?

viii:

Define Inheritance?

ix:

What are Friend functions? Write the syntax of declaring a friend function.

x.

What is dynamic binding or late binding?

xi.

What is the purpose of try and catch blocks?

xii:

What is an object?

Q. No. 2

Subjective Part

(4*9)

Write a class car that contains attributes of car's name (type string), top speed (type

float) and model name (type string). A Constructor with no arguments initializes the

data members and two member functions to input and display these attributes.

Q. No. 3

Define Shape class and two subclasses of it, Rectangle and Oval. Use draw function to

demonstrate polymorphic behavior by using these classes.

ustad What is operator overloading? Overload ipsertion and extraction operator for a time

Q. No. 5

Imagine a tollbooth

usadni.co

class called Tollbooth that has

attributes

total number_of_cars(int) and total amount(double). Write down a two parameter

constructor and an Input member function in this class. Read two objects and store into

a text file "tollbooth.txt".

Q. No. 6

Q. No. 7

Describe the function tempiate and class template. Discuss with the help of an example.

Explain following with example

i. Polymorphism

ii. Dynamic Memory Management

visit website: ustadni.com