You are on page 1of 3

PSG POLYTECHNIC COLLEGE, COIMBATORE - 641 004

Department of Computer Engineering


ZA0902 Object Oriented Programming & C++ - IV SEM, DCE MODEL QUESTION PAPER Time: 3 Hours Instructions:
1. Group I and Group II questions should be answered in the Main Answer book. 2. In all questions of Group I, the subdivision (a) carries 3 marks each and subdivision (b) carries 4 marks each. 3. Answer any SIX questions in Group I. 4. Answer any ONE question in Group II. 5. Answer all questions in Group III multiple choice type questions (which will be given to the candidates half an hour before the scheduled close of the examination) should be answered only in the space provided in the Main Answer Book.

Max. Marks: 75

GROUP I

Marks: 7 x 8 = 56

1. a) List the free store operators. What are the advantages of using free store operator over the function malloc ()? b) Under what circumstances the for loop is used to construct a looping in C++? Explain with an example. 2. a) What is an in-line function? State its advantages and disadvantages. b) Create a Class Book whose private data members are bookName, bookPrice and public member functions are getBookDetails( ) and displayBookDetailsi ). Create an object array of type Book and write a friend function alignBook ( ) to align the array of books in alphabetical order. 3. a) What is a destructor and When does a destructor member function invoked in a class? b) With an example C++ program, explain dynamic initialization of objects using constructors. 4. a) Describe the syntax of the multilevel inheritance in C++? b) Design three classes student, exam and results where result is inherited from exam and exam is inherited from student. Write possible constructors to initialize the values. Write a main function to test the constructor execution by creating objects. 5. a) List the rules for operator overloading. b) With an example, explain Function Overloading. 6. a) Base class has some virtual method and derived class has a method with the same name. If we initialize the base class pointer with derived object, calling of that virtual method will result in which method being called? justify your answer. b) Explain about virtual functions with an example. 7. a) Why are the words such as cin and cout not supported as keywords? b) Explain with example, how manipulators are used to output streams. 8. a) Write statements using seekg() to achieve the following: i) To move the pointer by 15 positions backward from current position. ii) To go to the beginning after an operation is over. iii) To go to byte number 50 in the file. b) Write a program to write text in the file. Read the text from the file from end of file. Display the contents of file in reverse order.

GROUP II
Marks: 1 x 9 = 9 9. Explain the basic concepts of oops in detail.

10. Create a class named complex with two members real and imaginary of float data type. Create three Objects of class complex add two objects and store the result in third one. Use operator overloading to add two objects.

Group III
1. A class is a a) derived ____________ data type. b) user defined c) abstract

Marks: 10x1=10

d) primitive

2. The parameters used in calling function are ____________. a) value parameters c) actual parameters b) formal parameters d) variables

3. A copy constructor is invoked when _________. a) a function returns by reference c) an argument is passed by value b) an argument is passed by reference d) an argument is passed by reference & value

4. The process of deriving new class from existing class is ___________. a) polymorphism c) inheritance b) data hiding d) dynamic binding

5. The --------- and ------------------- keywords do not apply to friend functions, as the class has no control over the scope of friends. a) public, protected c) protected, private b) private, public d) private, protected

6. A member function whose definition can be changed during run time is called ______.
a) friend b) virtual c) void d) inline

7. Which of the following is not a unary operator to overload? a) ++ b) & c)<< d)--

8. _______is object of istream class. a) >> b) << c) cin d) ==

9. get(char) is a member function of _________ class. a) iostream b) ostream c) ios d) filebuf

10. ____ is used to specify the number of digits to be displayed after decimal point.
a) fill() b) precision() c) setf() d) width()

You might also like