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;
}
Answer: D
You might also like to view...
A technician is replacing a bad optical drive. The computer has one hard disk drive installed and no other drives. On the Primary IDE controller, which of the following configurations should the replacement optical drive be? (Select TWO).
A. Slave B. Primary C. Master D. Secondary E. Cable Select
Name Oracle9i’s object privileges. What is used to grant all object privileges? What is used to grant privileges to everybody?
What will be an ideal response?