Download as pdf or txt
Download as pdf or txt
You are on page 1of 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