RTU Previous Exam Papers BE CS 3 rd Semester
Object Oriented Programming January 2013
UNIT – I
1. (a) Explain structure as a user defined data type in C with the Help of suitable example.
(b) Write an interactive program which processes date of birth using structure.
(c) Explain following with their syntax :
(i) Pointer to structure
(ii) Array of structure.
1. (a) What is difference between structured programming and object oriented programming ?
(b) What is object oriented paradigm ? Explain the various features of object oriented paradigm ?
What is class and object ? Describe the syntax for class and object specification with example. How does it accomplish data hiding ? Give an example.
UNIT – II
2. (a) What is constructor ? How many types of constructors are in C++ ? Describe with the help of a suitable example.
(b) Explain the concept of inline function in C++. How it is beneficial in programming ?
(a) Explain mechanism of accessing a private data member of the class from a non member function and justify it with a program in C++ to swap private data members of two classes.
(b) Explain static data members and static member functions with suitable example.
UNIT – III
(a) What is operator overloading ? State the rules to be followed for overloading operators.
(b) Write a program to overload unary (++) operator ? What are the limitations of overloading unary increment / decrement operator ? How are they overcome ?
(a) What is type conversion in C++ ? How it is achieved in user defined data types?
(b) Write a C++ program to make a class named “string”, which uses concept of operator overloading to concatenate two strings by (+) operator.
UNIT – IV
4. (a) What is inheritance ? What are the different forms of inheritance supported by C++ ? Explain each with suitable example.
(b) What is visibility mode ? What are different inheritance visibility modes supported by C++ ?
(a) What is pure virtual function ? What are the implications of making function pure virtual function ?
(b) What are abstract classes ? Explain the role of abstract class while building the class hierarchy.
UNIT – V
5. (a) Explain the multiple inheritance with example.
(b) What is virtual base class ? When do we make a class virtual ? Explain with example.
(a) What is generic programming? How is it implemented in C++ ? Write a program to implement swapping using templates.
(b) Explain try, throw and catch constructs used in C++ with their syntax.