You are on page 1of 2

1. Program to maintain a database of its employees.

The database is divided in to number of


classes whose hierarchical relationship is shown. The figure also shows the minimum
information required for each class. To specify all the classes and define functions to create
the database and retrieve individual information as and when required.

STAFF

CODE
NAME

TEACHER OFFICER

SUBJECT TYPIST GRADE


PUBLICATION
SPEED

REGULAR CASUAL

DAILY
WAGES

2. Program to implement the following inheritance. The class detail derives information from
both account and admin classes which in turn derive information from the class person.
Defining all four classes and writing a program to create update and display the information
contained in detail objects.
PERSON

NAME
CODE

ACCOUNT ADMIN

PAY EXPERIENCE

PERSON

NAME
CODE
EXPERIENCE
PAY

3. To create a base class called shape. Use this class to store two double type values that
could be used to compute the area of figures. Deriving two specific classes called triangle
and rectangle from the base shape. Adding to the base class, a member function get_data ()
to initialize base class data members and another member function display_area() to
compute and display the area of figures. Making display_area() as a virtual function and
redefine the function in the derived classes to suit their requirements.
Using these three classes, designing a program that will accept dimensions of a triangle
or a rectangle interactively, and display the area.
Area of rectangle=x * y
Area of triangle=1/2(x * y)