Assuming the definition,class BasePlusCommissionEmployee : public CommissionEmployeewhich of the following is false?a.The colon ( : ) in the header of the class definition indicates inheritance.b.The keyword public indicates the type of inheritance.c.All the public and protected members of class BasePlusCommissionEmployee are inherited as public and protected members, respectively, into class CommissionEmployee.d.CommissionEmployee is the base class and BasePlusCommissionEmployee is the derived class.Clear my choice
Question
Assuming the definition,class BasePlusCommissionEmployee : public CommissionEmployeewhich of the following is false?a.The colon ( : ) in the header of the class definition indicates inheritance.b.The keyword public indicates the type of inheritance.c.All the public and protected members of class BasePlusCommissionEmployee are inherited as public and protected members, respectively, into class CommissionEmployee.d.CommissionEmployee is the base class and BasePlusCommissionEmployee is the derived class.Clear my choice
Solution
The false statement is:
c. All the public and protected members of class BasePlusCommissionEmployee are inherited as public and protected members, respectively, into class CommissionEmployee.
This is false because the inheritance works the other way around. All the public and protected members of the base class (CommissionEmployee) are inherited as public and protected members, respectively, into the derived class (BasePlusCommissionEmployee), not the other way around.
Similar Questions
Which of the following statements is correct, when a class is inherited publicly?Select one:Public members of the base class become public members of derived class.Public members of the base class become private members of derived class.Private members of the base class become protected members of derived class.Public members of the base class become protected members of derived class.
When deriving a class from with protected inheritance, public members of the base class become___________ members of the derived class, and protected members of the base class become _____________ members of the derived class. a.private, private b.protected, protectedc.public, private d.private, protected Clear my choice
Explain the visibility of base class members for the access specifiers: private, protected and public while creating the derived class and also explain the syntax for creating derived class.
A class can be declared as __________ if it should not be sub classed.Select one:a.finalb.privatec.publicd.protected
What type of inheritance is used in the below declarations?1234class Human;class Worker : public Human;class Robot : public Human;class AI : public Human;
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.