END TERM EXAMINATION
FOURTH SEMESTER BTech
Subject Code: ETCS-210
Subject: Object Oriented Programming
Time: 3 Hrs M.M: 75
Note: Attempt any five questions. Question 1 is compulsory. Select one question from each unit.
Question 1: (2.5 × 10 =25)
(a) How does new operator in C++ is different from dynamic allocation functions in C?
(b) How static member is different from a non-static member?
(c) What do you mean by abstract class?
(d) What is inline function? How is it different from a macro?
(e) How does C++ support data abstraction?
(f) What do you mean by generic data type?
(g) Explain the role of reference variable with suitable example?
(h) What do you mean by namespace concept?
(i) What do you mean by base address of an array? Can you access the content of an array by incrementing the base address value?
(j) What is type casting and when is it used?
(a) Write a C++ code to store 6 integer numbers using dynamic memory allocation approach. (6)
(b) Write a program to print the following: (6.5)
3 3 3
4 4 4 4
(a) Write a function for multiplication of two matrices. (6)
(b) Explain various object oriented features. (6.5)
(a) What is a friend function? Write its merits and demerits. (6)
(b) Write a program that will add two time values measured in terms of hours and minutes. (6.5)
(a) What is copy constructor? Explain with suitable example. (6)
(b) Write a program that overloads a unary minus operator. (6.5)
Question 6: What do you mean by polymorphism? Explain various types of polymorphism with suitable example. (12.5)
(a) Write a template function that finds maximum value in an array which is passed to it as an argument. (6)
(b) Explain multiple inheritance with suitable examples. (6.5)
(a) How exception handling is performed in C++ (6.5)
(b) Write a C++ program that displays the content of a file. (6)
Question 9: Write a program that reads
Guru Gobind Singh Indraprastha University
from keyboard into five separate string objects and then concatenates them into a new string using append function. (12.5)