Question Paper: Object Oriented Programming with C++ : Question Paper Dec 2012 - Computer Science Engg. (Semester 3) | Visveswaraya Technological University (VTU)
0

Object Oriented Programming with C++ - Dec 2012

Computer Science Engg. (Semester 3)

TOTAL MARKS: 100
TOTAL TIME: 3 HOURS
(1) Question 1 is compulsory.
(2) Attempt any four from the remaining questions.
(3) Assume data wherever required.
(4) Figures to the right indicate full marks.
1 (a) Explain the following OOP features:
i) Class ii) Encapsulation iii) Polymorphism iv) Inheritance
(8 marks)
1 (b) Define inline function. Explain with an example program. What are the conditions, where inline functions can not be expanded?(6 marks) 1 (c) Define function overloading. Demonstrate with C++ program.(6 marks) 2 (a) Write a C++ program to keep track of the number of objects created by a particular class without using extern variable.(6 marks) 2 (b) Determine the output for the following snippers and comment.
i) class A
{ int x=10;
void display ()
{
cout<<"The value of x="<<x; <br=""> }
}
void main()
{
A obj;
obj.display();
}

ii) class A
{ int pvt;
Public; int*ptr-pub;
A() {
pvt=25;
pvt_pub=&pvt;
}
void print_private()
{
cout<<pvt&lt;<endl <br=""> }
};
void main ()
{
A objA;
*objA.ptr_pub=10;
objA.print_private()
}</pvt&lt;<endl></x;&gt;<>(8 marks)
2 (c) Demonstrate with C++ program for
i) Passing objects to functions
ii) Returning objects.
(8 marks)
3 (a) Define friend function. Explain with a C++ program to add 2 complex numbers.(8 marks) 3 (b) Write a C++ program to overload pre-increment and post-increment operators.(8 marks) 3 (c) State the advantages of Generic functions and classes and give the syntax for both.(4 marks) 4 (a) Write bubble sort program in C++ to sort in and double data type elements, using template function.(8 marks) 4 (b) List out the impact on public, protected and private data members of base class, when the base class is derived by
i) public
ii) protected
iii) private access specifies. Demostrate it by writing separate C++ program for each.
(12 marks)
5 (a) What ambiguities arise when multiple base class are inherited. How do you resolve them? Explain with a C++ program.(8 marks) 5 (b) Explain with a C++ program how a pass parameter to base-class constructor.(8 marks) 5 (c) Discuss the order of invocation of constructor and destructor.(4 marks) 6 (a) Show that in C++, virtual functions are hierarchical.(6 marks) 6 (b) What is an abstract class? Write a C++ program to implement the abstract class.(10 marks) 6 (c) Write a short note on early v/s binding.(4 marks) 7 (a) With examples, list and explain any four I/O manipulators in C++.(6 marks) 7 (b) Demonstrate the random access to files in C++, using relevant stream class functions.(6 marks) 7 (c) What is the necessity of exception handling? Show how multiple catch statement are used.(8 marks)


Write short note on the following :-

8 (a) Copy constructor(5 marks) 8 (b) New and delete(5 marks) 8 (c) Lists(5 marks) 8 (d) Vectors.(5 marks)

Please log in to add an answer.