GTU Information Technology (Semester 4)
Object Oriented Programming with C++
December 2015
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) Explain the benefits of Object Oriented Programming.
7 M
1(b) Explain the difference between structure and class in C++.
7 M

2(a) What do you mean by call by value and call by reference? Justify your answer with suitable example.
7 M
2(b) Describe The Following Terms In C++ With Example
i) Default Argument.
ii) Function Overloading.
iii) Destructor
iv) this pointer
7 M
2(c) What is friend function? Write a program to find out sum of two private data members x and y of two classes A and B using a common friend function. Assume that the prototype for both the classes will be void sum (A, B);
7 M

Solved any one question from Q.5 & Q.6
3(a) What are the characteristics of constructor in C++? Write a program to illustrate the use of copy constructor.
7 M
3(b) What is an operator function? Write a program to overload binary + operator as a member function.
7 M

4(a) Explain type conversion from class type to basic type and one class type to another class type with suitable example.
7 M
4(b) Write down the uses of static data member and static member function with suitable example.
7 M

5(a) What is inheritance? Why do we use of protected specifier for base class data members in inheritance? Explain hybrid inheritance with example.
7 M
5(b) What is polymorphism? How is it achieved in C++? Explain with suitable Example.
7 M

Solved any one question from Q.7 & Q.8
6(a) What is a stream? Describe various stream classes for console I/O operations in C++.
7 M
6(b) Explain various file mode parameters in C++. Write a program to copy the contents of a source file student1.txt to a destination file student2.txt character by character.
7 M

7(a) What is the purpose of using template in C++? Explain template function and template class with example.
7 M
7(b) Explain the mechanism of keywords try, throw and catch to handle Exceptions in C++. Explain with an example like "division by zero" situation.
7 M

8(a) Explain catch all exception and multiple catch exception with example.
7 M
8(b) Consider the following class structure as shown in the figure. The class Result derives information from the classes Internal, University and External respectively. The Internal and External classes access information from the Student class. Define all five classes and write a suitable program to create and display the information contained in Result object.

7 M



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