Solved

Consider the Following Class Definitions:
Class BClass
{
Public \quad

Question 30

Multiple Choice

Consider the following class definitions:
class bClass
{
public:
\quad void setX(int) ;
\quad void print() const;
private:
\quad int x;
};
Class dClass: public bClass
{
Public:
\quad void setXY(int,int) ;
\quad void print() const;
private:
\quad Int y;
};
Which of the following statements correctly redefines the member function print of bClass?


A) void dClass::print() const
{
\quad dClass:print() ;
\quad cout << " " << y << endl;
}
B) void dClass::print() const
{
\quad cout << x << " " << y << endl;
}
C) void bClass::print() const
{
\quad cout << x << " " << y << endl;
}
D) void dClass::print() const
{
\quad BClass::print() ;
\quad cout << "y = " << y << endl;
}

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents