VTU Computer Science (Semester 4)
Object Oriented Programming with C++
June 2014
Total marks: --
Total time: --
INSTRUCTIONS
(1) Assume appropriate data and state your reasons
(2) Marks are given to the right of every question
(3) Draw neat diagrams wherever necessary


1 (a) Compare object oriented programming with produced oriented progamming.
6 M
1 (b) Define function overloading. Write a C++ program to define overloaded functions to find volume of cube, volume of cylinder and volume of cuboid.
8 M
1 (c) With an example, explain when the set of overloaded functions can be combined into a single function definition by using default arguments.
6 M

2 (a) Define the terms class and object. Write a C++ program to define a class called distance with feet and inches as data members and get(), put() and add() as members to read. Display and add two distance objects.
10 M
2 (b) With an example, illustrate the characteristics of a constructor.
5 M
2 (c) Write a short note on destructors.
5 M

3 (a) With an example, explain the use of friend functions in C++.
6 M
3 (b) With an example, explain when to use member function and when to use friend function as an operator function for overloading binary operators.
8 M
3 (c) Write a C++ program to arrange set of integer and floating point values in acending order by using a function template.
6 M

4 (a) With the help of syntax for creating the derived class, explain the visibility of the base class members, for the access specifiers private, protected and public.
8 M
4 (b) With an example, explain multiple inheritance.
6 M
4 (c) Explain the necessity of protected data members, with an example.
6 M

5 (a) Explain the use of virtual base classes in diamond shape inheritance.
8 M
5 (b) Explain the order of invocation of constructors and destructors in multilevel inheritance.
8 M
5 (c) Write a short note on use of scope resolution operator in inheritance.
4 M

6 (a) Define a virtual function. Explain the need of a virtual function with an example.
6 M
6 (b) Write a C++ program to illustrate the virtual function in hierarchical inheritance.
8 M
6 (c) Define abstract class. Write a C++ program to illustrate abstract class.
6 M

7 (a) Explain the following output manipulators:
i) setω() ii) setprecision() iii) setfill()
6 M
7 (b) Briefly explain the facilities available in fstream class for file operations.
6 M
7 (c) Write a C++ program to read a binary file, which contains the detail of 5 students such as Name, rollno, age and grade obtained by the student. Display the above read details on the screen.
8 M

8 (a) What is exception handlling? Write a C++ program to demonstrate the "try", "throw", and "catch" keywords for implementing exception handling.
10 M
8 (b) List and explain five member functions from vectors and lists classes in STL.
10 M



More question papers from Object Oriented Programming with C++
SPONSORED ADVERTISEMENTS