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
501 views
in Object Oriented Programming with C++ by (49.1k points)
closed by

#include

#include

#include

using name spacestd;

class publisher

{

char pname[15];

char hoffice[15];

char address[25];

double turnover;

protected:

char phone[3][10];

void register();

public:

publisher();

∼ publisher);

void enter data();

void disp data(); };

class branch

{

charbcity[15];

char baddress[25];

protected:

intnoofemp;

public:

charbphone[2][10];

branch();

∼ branch();

void have data();

void give data();

};

class author: public branch, publisher

{

intaut_code;

charaname[20];

float income;

public:

author();

~author();

voidgetdata();

voidputdata();

};

Answer the following questions based on the above given program:

1. Which type of Inheritance is shown in the program?

2. Specify the visibility mode of base classes.

3. Give the sequence of Constructor/Destructor Invocation when object of class author is created.

4. Name the base class(/es) and derived class (/es).

1 Answer

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

1. Multiple inheritance.

2. Private for publisher.

Public for branch

3. branch(); // constructor of branch class

publisher (); // constructor of publisher class

author (); // constructor of author class

∼author (); // destructor of author class

∼publisher (); // destructor of publisher class 

∼branch (); // destructor of branch class

4. Base class(/es): branch and publisher Derived class (/es): author.

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.

...