Sei sulla pagina 1di 1

ASSIGNMENT

Object-Oriented Programming through C++ BCA(S3)08

July-December 2012 Dec 11

Total marks = 50
1. Answer the following questions: a) What is namespace ? b) What is a null object ? c) What is the difference between function overloading and operator overloading ? d) What are the uses of abstract class and virtual class in C++? 2X4=8

2. Answer the following questions: a) b) What do you mean by class scope ? What is global class and local class ?

3 X 4=12

How is dynamic initialization of objects is achieved ? What are the similarities between constructor overloading and function overloading ?

c)

How do the properties of the following derived classes differ : i) class D1 : private B{....}; ii) class D2: public B{....};

d)

A positive integer n is said to be prime (or, a prime) if and only if n is greater than 1 and is divisible only by 1 and n . For example, the integers 17 and 29 are prime, but 1 and 38 are not prime. Write a function named is_prime that takes a positive integer argument and returns as its value the integer 1 if the argument is prime and returns the integer 0 otherwise.

3. Answer the following questions: a) Write a function named rotate_right that takes as its arguments the following: (1) an array of floating point values; (2) an integer that tells the number of cells in the array;

5 X 2=10

The function should shift the contents of each cell one place to the right, except for the contents of the last cell, which should be moved into the cell with subscript 0 . Thus, for example, if the array passed to the function looks like this: 0 1 2 3 4

5.8 | 2.6 | 9.1 | 3.4 | 7.0 then when the function returns, the array will have been changed so that it looks like this: 0 1 2 3 4

7.0 | 5.8 | 2.6 | 9.1 | 3.4 The function should not return a value. b) What are virtual base class ? What is their significance ? Describe how an object of a class that contains objects of other class is created.

4. Answer the following questions : a)

10 X 2=20

Write a C++ program to read and display information about the employees and managers. Employee is a class that contains employee number, name, address and department. The class manager contains all information of the class employee and a list of employee working under a manager.

b)

A school maintains a data file that contains students name, admission number, class and section. Records in the file are stored in ascending order of admission number. Write a complete program in C++ using a menu that will allow an administrative staff to carry out following operations : a) Add a new record, b) Delete a record, c) Modify an existing record, d) Retrieve and display an entire record that corresponds to a given admission number 1 While inserting a record or deleting a record, relative position of the records are not to be disturbed.

*****

Potrebbero piacerti anche