Sei sulla pagina 1di 1

Enroll. No.

__________________
G. H. Patel College of Engineering and Technology
Mid-Semester Examination
A.Y 2015-16, Semester IV
Course Code: 2140705
Object Oriented Programming with c++
Computer Engineering (07) / Information Technology (16)
Date: 15/03/2016
Time: 11:00 AM to 12:15 PM Max. Marks: 20

Notes:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.

Q. 1 A Explain friend function with example. [4]


B Explain following terms. [2]
1) Data Abstraction 2) Polymorphism 3) Dynamic binding 4) Inheritance

Q. 2 A Explain call by reference and return by reference with example. [2]

B Explain constructor and destructor with example. [2]


OR
Q. 2 A Explain copy constructor with suitable example. [2]

B Explain private, public and protected access specifier. [2]

Q. 3 A Write a program to overload new and delete operator. [5]

B Create an abstract base class called figure and derive close class from that. Declare [5]
two more classes called polygon and ellipse using close class. Define object of the
polygon and ellipse class. All classes must have appropriate member functions
including constructors and destructors.
OR
Q. 3 A Declare a class called string. Object of this string class represents a character [5]
string. Overload = = and + operator for objects of string class to perform respective
operation of comparing two strings and adding two strings to have new string.

B Create class called person having name and code, class account having a [5]
payscale, class admin having experience as a data members. Consider a class
master derives information from both account and admin classes which in turn
derive information from the class person. Define all four classes and write a
program to create and display the information contained in master object.

Potrebbero piacerti anche