
Consider the following class definitions: class bClass
{
Public:
Void setX(int a) ;
//Postcondition: x = a;
Void print() const;
Private:
Int x;
};
Class dClass: public bClass
{
Public:
Void setXY(int a,int b) ;
//Postcondition: x = a; y = b;
Void print() const;
Private:
Int y;
};
Which of the following correctly sets the values of x and y?
A) void dClass::setXY(int a, int b)
{
BClass::setX(a) ;
Y = b;
}
B) void dClass::setXY(int a, int b)
{
X = a;
Y = b;
}
C) void dClass::setXY(int a, int b)
{
X = bClass::setX(a) ;
Y = bClass::setY(b) ;
}
D) void dClass::setXY(int a, int b)
{
X = bClass.setX(a) ;
B = y;
}
Correct Answer:
Verified
Q19: Suppose that bClass is a class. Which
Q22: Consider the following class definitions:
class bClass
{
Public:
Void
Q24: To define new classes in C++,you create
Q26: In _,the derived class is derived from
Q27: The preprocessor directive _ is used to
Q30: Consider the following class definitions:
class
Q33: Which of the following is true about
Q35: The _ members of an object form
Q36: C++ provides _ functions as a means
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