
Consider the following class definitions:
class bClass
{
Public:
Void set(double a,double b) ;
//Postcondition: x = a; y = b;
Void print() const;
BClass() ;
//Postcondition: x = 0; y = 0;
BClass(double a,double b) ;
//Postcondition: x = a; y = b;
Private:
Double x;
Double y;
};
Class dClass: public bClass
{
Public:
Void set(double a,double b,double c) ;
//Postcondition: x = a; y = b; z = c;
Void print() const;
DClass() ;
//Postcondition: x = 0; y = 0; z = 0 ;
DClass(double a,double b,double c) ;
//Postcondition: x = a; y = b; z = c;
Private:
Double z;
};
Which of the following dClass constructor definitions is valid in C++?
A) dClass::dClass(double a, double b, double c)
: bClass()
{
X = a;
Y = b;
Z = c;
}
B) dClass::dClass(double a, double c)
{
X = a;
Z = c;
}
C) dClass::dClass(double a, double b)
: bClass()
{
X = a;
Y = b;
}
D) dClass::dClass(double a, double b, double c)
: bClass(a, b)
{
Z = c;
}
Correct Answer:
Verified
Q6: The private members of a base class
Q9: The class io is the base class
Q12: If the derived class does not override
Q19: Suppose that bClass is a class. Which
Q24: To define new classes in C++,you create
Q25: Consider the following class definitions: class bClass
{
Public:
Void
Q26: In _,the derived class is derived from
Q33: Which of the following is true about
Q35: The _ members of an object form
Q38: If the derived class classD overrides a
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents