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

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


Answer: D

Computer Science & Information Technology

You might also like to view...

The Web page in Figure 5-30 needs some help in organizing the text on the page. Someone has already tried to use some organizing principles when creating the page, but one principle in particular is lacking. Which one is it? Make a photocopy of the page, and, with paper and scissors, make a new version that applies the missing principle to communicate more clearly.

Computer Science & Information Technology

Which Windows program is used to set file attributes?

A) Device Manager B) Task Manager C) Explorer/File Explorer D) Internet Explorer

Computer Science & Information Technology

Which of the following cables uses an ST connector by default?

A. CAT5e B. Fiber C. CAT5 D. CAT6

Computer Science & Information Technology

An IDPS __________________ server is the central repository for sensor and agent data.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology