Anda di halaman 1dari 3

Question Bank: Object Oriented Programming (9036)

Class: SYIF (Semester – III)


Chapter No. 04 Inheritance
Summer 2004 (Yearly Pattern): Marks=24

1. Describe the syntax of multilevel inheritance. 4


2. Describe the purpose of ‘protected’ access specifier in C++. 4
3. Define the base and the derived classes .Also identify and define the base
and derived classes from the class relationship diagram (fig. no.1) given
below. Assume suitable functions. 8
 
  class name: Staff
  member variables:
staff_code
 
 
 
Class name: Teacher
  class name: Officer
member variables : subject member variables: grade
 

4. Write the program to implement inheritance as shown in fig. given below.


Assume suitable member functions create at least one object. 8

class name : Employee


member variables:
Emp_id,name

class name : Worker


member variables :
Daily_wages

Summer 2005 (Yearly Pattern): Marks=20


1. What is virtual base class? Explain with suitable example. 4
2. Identify the inheritance shown in the fig. Write definition of each class Write
suitable member functions to accept and display data for each class. 8
 
class name: employee class name: emp_union.
 
member variables: member variables:
  emp_id,emp_name. member_id
 
 
 
class name : emp_info
member variables:
basic_salary. -1-
 
                                                                                                        
3. What are the different types of inheritance? Describe any two with
example. 8

Summer 2006 (Yearly Pattern): Marks=24


1. List the different types of inheritances. 4
2. Explain the different access specifiers used in C++. 4
3. Write a program to implement the inheritance as shown in the figure.
4. Assume suitable member function 8
class name : Box
member variables:
length, width, height

class name : Cupboard


member variables :
no_of_shleves

5. Write a program to implement the inheritance as shown in figure given


below. Assume suitable member functions. 8

class name: Student


member variables:
roll_no, name

Class name: Engg_stud class name: Diploma_stud


member variables : subject member variables: result

Winter 2007 (Semester Pattern): Marks=12


1. Explain concept of virtual base class with suitable example. 4
2. Identify inheritance shown in following figure. Implement it by assuming
member function. 8

Class Name : Student

Member Variable :Roll No.,


Name

Class Name : Exam Class Name : Library


Member Variable : Subject Name Member Variable :Membership No.

Summer 2008 (Semester Pattern): Marks=20


1. What do you mean by inheritance? Give different types of inheritance? 4

-2-
2. What is the scope of base class members inherited in derived class in the
following code : 4
class base
{
int i, j;
public:
void set (int a, int b);
void show( );
};
class derived : public base
{ int Ki;
public:
derived( int x );
------------
------------
------------
};
& state in how many types we can inherits properties of base class in Derived
class?
3. Write a program for following hierarchy inheritance in the given Figure
below. Assume suitable member function. 4

Staff
Code

Teacher Officer
Subject Grade

4. Write a program to implement inheritance as shown in figure below. Assume


suitable data member function to accept and display function? 8

Customer
Name, Phone

Depositor
Acc_no, Balance

Borrower
Loan, loan_amount

-3-

Anda mungkin juga menyukai