CS-72 : C++ And Object Oriented Programming-December,2006

  JHARKHAND BOARD You are here
BACHELOR IN COMPUTER APPLICATIONS

Term-End Examination

December, 2006

CS-72 : C++ AND OBJECT ORIENTED PROGRAMMING

Time : 2 hours Maximum Marks : 60

Note : Question number 1 is compulsory. Attempt any three questions from the rest.

1. (a) Explain any five advantages of Object Oriented Programming. (5)

(b) Explain the need of inheritance and list any three advantages of it. (5)

(c) Explain the purpose of the following with a suitable example of each : (6)

(i) Use Case Diagram

(ii) Interaction Diagram

(d) Write C++ code to create a class date. Using this class, calculate the age of a person as on the current date.(5)

(e) List the various restrictions with operator overloading. Write a C++ program to illustrate the

overloading of increment operator.(9)

2. (a) Define the term exception handling. Write a program to raise an exception if an attempt is made to divide a number by zero. (6)

(b) Give output of the following (4)

{

int a =10,b=20,d;

d = b++;

cout < d = ++a;

cout < }

3. (a) Explain the purpose of function overloading. Write a C++ program that uses a function to check whether a given number is divisible by another number or not.Give proper comments whether the denominator number is a prime number or not.(8)

(b) Explain briefly static data members. (2)

4. (a) Define a friend function. Explain the relation of friend function with respect to Public, Private and Protected data members of the class. (5)

(b) Write a C++ program to find the sum of all digits in a five digit number. (For example, if given number is 12345 then the output is 1+2+3+4+5=15). (5)

5. Define the following with an example of each : (10)

(i) this pointer

(ii) Destructor

(iii) Typecasting

(iv) Abstract class

(v) Parameterized Constructor