COMPUTER SCIENCE INHERITANCE

(iii) Name the private member function(s) of class Teacher.

Ans: Teacher::Display( )

(iv) Is the member function OUT() accessible the objects of Dept?

Ans: Yes. Since it is public member function.

DELHI 1999:

2.a) What do you understand by visibility modes in class derivations? What are these modes?

2

Ans: It is given in chapter 4, classes and object as two answers. Ie Difference between private and protected, private and public.

2.c) Consider the following declarations and answer the questions below:

class vehicle
{ int wheels;
protected:
int passenger;
void inputdata(int,int);
void outputdata();
};
class heavy_vehicle:protected vehicle
{
int diesel_petrol;
protected:
int load:
public:
void readdata(int,int);
void writedata();
};
class bus:private heavy_vehicle
{
char make[20];
public:
void fetchdata(char);
void displaydata();
};

(i) Name the base class and derived class of the class heavy_vehicle.

Ans:

Base class of heavy_vehicle – vehicle
Derived class of heavy_vehincle – bus

(ii) Name the data member(s) that can be accessed from function displaydata.

Ans:

bus::make
heavy_vehicle::load
vehicle::passenger

 

CBSE Computer Science Solved Revision Tour By Mr. Ravi Kiran ( mrkdata@yahoo.com )


Warning: include_once(../../ebooks-footer19.php): Failed to open stream: No such file or directory in /home/cbseguess/public_html/ebooks/xii/coumputer-science/inheritance10.php on line 132

Warning: include_once(): Failed opening '../../ebooks-footer19.php' for inclusion (include_path='.:/opt/cpanel/ea-php83/root/usr/share/pear') in /home/cbseguess/public_html/ebooks/xii/coumputer-science/inheritance10.php on line 132

Warning: include_once(../../../footer19.php): Failed to open stream: No such file or directory in /home/cbseguess/public_html/ebooks/xii/coumputer-science/inheritance10.php on line 134

Warning: include_once(): Failed opening '../../../footer19.php' for inclusion (include_path='.:/opt/cpanel/ea-php83/root/usr/share/pear') in /home/cbseguess/public_html/ebooks/xii/coumputer-science/inheritance10.php on line 134