0% found this document useful (0 votes)
236 views3 pages

OOP Sample Question Paper - 2

This sample question paper contains questions on C++ concepts like classes, inheritance, polymorphism, operator overloading, file handling etc. It has 6 questions with the first 4 questions having subparts that need to be answered. The questions assess understanding of key C++ features and their application through programming problems. The last question tests error detection and explanation of concepts like eof(), fail(), cin and cout.

Uploaded by

api-3728136
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
236 views3 pages

OOP Sample Question Paper - 2

This sample question paper contains questions on C++ concepts like classes, inheritance, polymorphism, operator overloading, file handling etc. It has 6 questions with the first 4 questions having subparts that need to be answered. The questions assess understanding of key C++ features and their application through programming problems. The last question tests error detection and explanation of concepts like eof(), fail(), cin and cout.

Uploaded by

api-3728136
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Sample Question Paper – II

9036
3 Hours / 80 Marks Seat No.

Q 1: Attempt any Eight of the following: (2 x 8 = 16)

a) Why we need to include iostream.h file?


b) What is the use of insertion & exertion operator?
c) Enlist the keyword added the C++ than C.
d) What is the type casting?
e) List the advantages of inheritance?
f) Why prototype variables are needed in class?
g) Write the use of seekg ( ) function?
h) State the use of ‘this’ pointer?
i) What is the use of getline ( ) function?
j) Write the differences between width ( ) & setw ( ).

Q 2: Attempt any THREE of the following: (4 x 3=12)

a) Write the rules for operator overloading.


b) How to create your own manipulator? Explain with example.
c) Write the program to illustrate use of constructor overloading.
d) Explain the function overloading.

Q 3 : Attempt any THREE of the following : (4 x 3=12)

a) How the function can be called using base pointer? Explain


b) Differentiate call by value & call by reference.
c) What is compile time polymorphism?
d) What will be the error in the following program? Give the solution on this error.

class Region {
int m,t ;
Region()
{
m=0;
}
public:
Region (int y)
{
t=y;
}
}
main ()
{
Region r;
-1-
Region r (20);
}

Q 4 : Attempt any TWO of the following: (8 x 2=16)

a) Write program to declare a class ‘staff’. Having data member as name & post.
Accept this data for 5 staffs & display name of the staff who are H.O.D.
b) Write a program to overload = = in a class ‘string’to check the equality of string .
c) Write a program for below class hierarchy for the employee where the base class is
employee & derived classes are programmer & manager. Here, make display ( )
function virtual which is common for all & which will display information of
programmer & manager interactivity.

Employee

Programmer Manager

Q 5: 1) Attempt the following: (4 x 1=4)


Explain the use of new, delete, const & inline.
2) Attempt any ONE of the following: (8 x 1=8)
a) Write a program to accept source & destination file names from user & copy
contents of source file into destination.
b) Write a program to declare class ‘birthday’ having data members day, month &
year, Accept & display this information for 5 objects using pointer to array of object.

Q 6: Attempt any THREE of the following: (4 x 3=12)


a) Point out the error if any in following code, else write output.

class first {
public: int m;
first (int x)
{
m=x*x;
}
};
class second
{
public: first a(10);
};
class third
{
public: second b;
};
void main ()
{
third c;
cout <<c.b.a.m;
}

b) Give syntax & use of following with respect to file.


1. eof ( ) 2. fail ( )
-2-
c) Write a program to open a file using its name as command line input & display its
contents.
d) Explain what is cin & cout in detail.

-3-

You might also like