Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
+1 vote
3.1k views
in Object Oriented Programming with C++ by (49.1k points)
closed by

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()

1 Answer

0 votes
by (54.8k points)
selected by
 
Best answer

1. (c) vehicle

2. (d) All of these

3. (d) All of these display_data()

4. (d) All of these display_data()

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

...