Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

3. (TCO 4) A derived class (Points : 4) can never access public members of a bas

ID: 3764915 • Letter: 3

Question

3. (TCO 4) A derived class (Points : 4)        can never access public members of a base class.
       can directly access public members of a base class.
       cannot change the value of public members of a base class.
       can only directly access private members of the base class.

Question 4. 4. (TCO 4) The constructors of a derived class (Points : 4)        cannot directly initialize private members inherited from the base class.
       can directly initialize any members inherited from the base class.
       cannot directly initialize public members inherited from the base class.
       can directly initialize private member functions inherited from the base class.

Explanation / Answer

Answers with explanations:

3.   (a) False //Derived class can access public member of base class
   (b) True    //Derived class can directly access public member of base class
   (c) False   //Derived class can change value of public member of base class but in its own class/scope
   (d) False   //Derived class cannot access private member of base class.

4.   (a) True    //It cannot initialize private memebers.
   (b) False   //It cannot initialize private memebers.
   (c) False   //It can initialize public members.
   (d) False   //private members are private to the class

5.   (b) A derived class can redefine any public member function of the base class
   //Public and protected member functions are only visible to the derived class.Hence derived class only redifine these functions.

6.   (c) Encapsulation
   //Encapsulation combines datas and functions which operates on these data in a single unit called class.

7. (a) B Class constructor first,A Class constructor second
   //First super class constructor is called then sub class constructor.

8.   (c) Mustang is an automobile
   //here automobile is a base class and Mustang is a derived class
   //Mustang has inherited all the properties of automobile like wheels,stearing etc.

9.   (d) Destructor
   //Derived class cannot inherit Constructor,Destructor,overloaded operators.

10.   (a) namespace
   //namespace is a collection of all names used in a program

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote