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
0 votes
1.3k views
in Computer by (45.3k points)
closed by

Answer the questions (i) to (iv) based on the following :

class Teacher 

{

int TCode;

protected:

char Name[20];

public: Teacher();

void Enter();

void Show();

};

class Course

{

int ID;

protected;

char Title [30];

public: Course();

void Initiated;

void Display();

};

class Schedule : public Course, private Teacher 

{

int DD, MM, YYYY;

public:

Schedule();

void Start();

void View();

}; 

void main()

{

Schedule S;

}

(i) Which type of Inheritance out of the following is illustrated in the above example? Single Level Inheritance, Multilevel Inheritance, Multiple Inheritance.

(ii) Write the names of all the members, which are directly accessible by the member function View() of class Schedule. 

(iii) Write the names of all the members, which are directly accessible by the object S of class Schedule declared in the main () function.

(iv) What will be the order of execution of the constructors, when the object S of class Schedule is declared inside the main() function?

1 Answer

+1 vote
by (50.9k points)
selected by
 
Best answer

(i) Multiple Inheritance is illustrated in the given example.

(ii) Members directly accessible by the member function view() of Class Schedule are: DD, MM, YYYY, ID

(iii) Member functions directly accessible through the object S of class Schedule are: Start(), View(), Initiate(), Display(), Enter(), Show () 

(iv) The order of execuation of constructors, when the object S of Class Schedule is declared inside the main() function is:

Course(), Teacher(), Schedule()

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.

Categories

...