Kindly solve this program.

Write your question here.
Question

a. Name the data members that can be accessed by an object of bus class
b. Is the member function output data accessible to the objects of heavy_vehicle class
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  class vehicle
{
int wheels;
public:
void inputdata( int, int);
void outputdata();
protected :
int passenger;
};
class heavy_vehicle : protected vehicle
{
int diesel_petrol;
protected:
int load;
public:
void readdata( int, int);
void writedata();
};
class bus: private _heavy_vehicle
{
char marks[20];
public:
void fetchdata( char );
void displaydata();
};


Last edited on
there's protected and private inheritance involved along the way to the bus class. for your own learning why don't you write down what you think might be the answers and the reasons and post them and then we can discuss?
I have some doubt in this area. Thats why I Post
If you don't show what you have, then how could we point out where you have mistakes?
Dear Keskiverto

Which data members that can be accessed by an object of bus class?
Please reply...

Topic archived. No new replies allowed.