You are on page 1of 3

Fourth Semester B.

E Degree Examination (Common to CS and IS) Model Question Paper I 06CS44 Object Oriented Programming with C++ Note: Answer any FIVE Full questions, selecting at least TWO Questions from each PART

Time: 3 Hours PART -A

Maximum marks : 100

1. (a) What is the need for structures in C? Explain with suitable example. (6) (b) What is object oriented programming? Compare Object Oriented with Procedure Oriented Programming? (6) (c) What is an inline function? What is the advantage of having a function inline? Write a C++ program to find maximum of two numbers using inline functions. (8) 2. (a) Explain the use of this pointer with an example. (5) (b) What are friend classes? Explain with example. (5) (c) Write a C++ program to sort the list of students depending on their roll Numbers (10) 3. (a) Explain how new and delete operators manage memory allocation / deallocation dynamically? (6) (b) What is a constructor? Explain different types of Constructors with examples. (7) (c) Write a C++ Program to generate Fibonacci series using copy constructors (7) 4. (a) What is inheritance? Explain different types of inheritance with examples. (b) Write a note on visibility of member functions based on private and protected derivations (c) Explain the order of invocation of constructors and destructors with examples. PART B 5. (a) Explain virtual functions and write a C++ program to demonstrate dynamic polymorphism. (b) Distinguish between virtual function and pure virtual functions. (c) Write a note on I/O stream classes of C++. 6. (a) Write a C++ program to perform addition and multiplication of two complex numbers by overloading + and * operators (b) Explain different file pointer manipulation functions in C++. 7. (a) What is operator overloading? Write a C++ program to compare two data values representing distances in feet and inches using operator overloading (b) Explain new style cast operators in C++. 8. (a) Write a C++ program for sorting a list of integer, floating point numbers and characters by bubble sort technique using template functions. (b) What is exception handing and how is it treated in C++. (10) (5) (5)

(10) (5) (5) (10) (10) (10) (10) (10) (10)

Fourth Semester B.E Degree Examination (Common to CS and IS) Model Question Paper II 06CS44 Object Oriented Programming with C++ Note: Answer any FIVE Full questions, selecting at least TWO Questions from each PART

Time: 3 Hours
1 (a) (b) (c) 2 (a)

Maximum marks : 100

PART- A With examples compare structures in C with classes in C++. (4) What is function overloading? What are the advantages of overloading a function? Write a program in C++ to overload the function add(s1,s2) where S1 and s2 are integers and floating point values. (10) With an example discuss the significance of function prototyping. (6)

what is the role played by private and public access specifiers in case of structures and classes? Explain with suitable examples. (8) (b) Explain with an example how one can bridge two classes using friend function. (6) (c) Write a note on Nested class. (6) What is Dynamic Memory Management? Write a C++ program to create array of objects at runtime. (12) Is overloading of constructors and destructors possible? Justify your answer? (8) What is reusability? How do you achieve this in c++? What are the different ambiguities involved in multiple inheritance and how they are resolved? Write a C++ program to use a base class pointer to point to an object of derived Class without the need for type casting? PART B (6) (8) (6)

3. (a) (b) 4. (a) (b) (c)

(a) (b) (c)

What are virtual functions? Explain the mechanism of virtual functions. With a neat diagram explain the class hierarchy for stream handling in C++. What is pure virtual function? Explain with an example. Distinguish between text and binary files in C++. What is operator overloading? Explain its advantages. Write a C++ program to overload + operator to concatenate two string variables. What are the rules for overloading operators? Write a C++ program to create a class String by overloading assignment operator. Explain how to overload pointer to member operator in C++. Write a note on (i) static cast operator (ii) dynamic cast operator. Explain RTTI in detail. Write a C++ program using function templates for accepting integer and floating values to perform stack operation.

(8) (6) (6) (6) (10) (4) (8) (4) (8) (6) (8)

6. (a) (b) (c) 7. (a) (b) (c) 8. (a) (b)

(c)

What is Exception handling? Explain try, throw , catch constructs in C++

(6)

You might also like