You are on page 1of 3

Question Paper Code

:

B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER 2009 Third Semester

Computer Science and Engineering

CS 2203 — OBJECT ORIENTED PROGRAMMING (Common to Information Technology) (Regulation 2008)

1. 2. 3. 4. 5. 6. 7.

List any four Object Oriented programming concepts. What is an abstract class?

What is a copy constructor?

What are the operators that cannot be overloaded? What are templates? Illustrate the exception handling mechanism. What are the visibility modes in inheritance? Write the prototype for a typical pure virtual function. What are the file stream classes used for creating input and output files?

42
8. 9. 10.

1

List out any four containers supported by Standard Template Library.

42

Answer ALL Questions

PART A — (10 × 2 = 20 Marks)

1

Time : Three hours

42
T3028
Maximum : 100 Marks

1

Reg. No. :

(8) 1 T 3028 PART B — (5 × 16 = 80 Marks) . Write a C++ program that can take either two integers or two floating point numbers and outputs the smallest number using class. (4) Write a C++ program using class template for finding the scalar product for int type vector and float type vector. : name. (12) Explain the various types of constructors. percentage marks. (4) 14. (12) 13. (16) Write the syntax for member function template. 42 1 Create appropriate base and derived classes. (a) (i) (ii) Write a C++ program handling the following details for students and staff using inheritance. (12) Explain the different forms of inheritance.y) coordinates of two points and outputs the distance between them using constructors. (4) 12. Data abstraction and encapsulation. (8) Or (b) (i) (ii) What are the rules to be followed in function overloading. sec) and outputs their sum using constructors and operator overloading.(ii) Write a C++ program that inputs two numbers and outputs the largest number using class. salary. (a) (i) (ii) Write a C++ program that takes the (x. address. (a) (i) Explain the idea of Classes. (a) (i) (ii) 42 Or Staff details Or 2 (b) Write a C++ program that takes two values of time (hr. (12) 42 (4) (4) 11. Student details : name. Input the details and output them. address. friend functions and function overloading. 1 Or Write a C++ program that illustrates multiple catch statements. min. (12) (b) (i) (ii) Explain how rethrowing of an exception is done.

(a) (i) (ii) Explain any two functions used for manipulating file pointers.15. (12) 1 (b) (i) Explain the need for pure virtual functions. A data file ‘‘DATA’’ contains the name and marks of a set of students. one containing the even numbers. From this list. (4) Write a C++ program using lists from STL to input 10 numbers and store them in a list. Write a C++ program that reads the contents of this file into an object. (4) . (12) Or (b) (i) Explain any two sequence containers supported by Standard Template Library. sorts the data in descending order of marks and writes the result to an output file ‘‘OUTPUT’’. create two more lists. (12) (ii) 42 1 42 3 ——————————— 1 T 3028 42 (4) (ii) Write a C++ program for calculating the area of rectangle and circle using run-time polymorphism. Output all the three lists. and the other containing the odd numbers.