Based on the following class declaration answer the questions (from 9.1 to 9.4)
class vehicle
{
int wheels;
public:
void input_data(float,float);
void output_data();
protected:
int passenger;
};
class heavyvehicle : protected vehicle {
int diesel_petrol;
protected:
int load;
protected:
int load;
public:
voidread_data(float,float)
voidwrite_data(); };
class bus: private heavy vehicle {
charTicket[20];
public:
voidfetch_data(char); voiddisplay_data(); };
};
1. Which is the base class of the class heavy_vehicle?
(a) Bus
(b) heavy_vehicle
(c) vehicle
(d) both (a) and (c)
2. The data member that can be accessed from the function displaydata()
(a) passenger
(b) load
(c) Ticket
(d) All of these
3. The member function that can be accessed by an objects of bus Class is
(a) input_data()
(b) read_data(), output_data()write_data()
(c) fetch_data()
(d) All of these display_data()
4. The member function that is inherited as public by Class Bus
(a) input_data()
(b) read_data(), output_data()write_data()
(c) fetch_data()
(d) All of these display_data()