BBA Iind SEMESTER EXAMINATION 2008-09 s57

Integrated BCA + MCA III (Third) Semester Examination 2011-12

Course Code:ICA301 Paper ID:0773101

Object Oriented Programming with C++

Time: 3 Hours Max. Marks: 70 Max Marks: 75

Note: Attempt any six questions in all. Q. No. 1 is compulsory.

1. Answer any five of the following (limit your answer in 50 words). (4x5=20)

a) What is polymorphism? Explain with example?

b) Why do we need the preprocessor directive #include <iostream>?

c) What do you mean by dynamic initialization of a variable? Give an example?

d) How does a C++ structure differ from a C++ class?

e) When do we declare a member of a class static?

f) What does inheritance mean in C++?

g) What is function overloading? Explain with example.

h) What does ‘this’ pointer point to?

2. a) Discuss the role of assignment operator (=) in variable initialization. Also discuss the role and importance of pointers in C++. (5)

b) Explain the difference between a variable, reference variable, a constant variable and a pointer variable. Support your answer with examples. (5)

3. Write a C++ program to process the sales activity for 20 salesmen. Each salesman deals in separate product and is assigned an annual target. At the end of the month, his monthly sale is added into the sales till date. At the end of the year, his commission is calculated as follows: If sales made are more than target then the commission is 25% of the extra sales made + 10% of the target if sales made is equal to the target then commission is 10% of the target. Otherwise commission is zero. (10)

4. a) What do you mean by a temporary instance of a class? What is their use? How is it created? (5)

b) “Only a function that has access to the constructor and destructor of a class can use the object of this class”. Comment on this statement. (5)

5. a) In what order are the class constructors called when a derived class object is created. (5)

b) What are the different forms of inheritance? Give an example for each. (5)

6. a) Discuss pure virtual function? Explain with suitable example. (5)

b) Write a program that reads a text file and creates another file that is identical except that every sequence of consecutive blank spaces is replaced by a single space. (5)

7. a) What is operator overloading? Explain with example. (5)

b) How do we perform error handling in C++? Give some examples. (5)

8. a) Differentiate between early and late binding with suitable example. (5)

b) Describe C++ memory map when a program is executing. Highlight the role and use of Heap area. (5)