subject

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 functionprint 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;

}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:00
Designing a mobile web page is a little different from designing a regular web page. name at least three features that should be considered when designing a website that is mobile phone-friendly, and briefly explain why they are important.
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
question
Computers and Technology, 24.06.2019 13:50
What does code do? a creates a text box that says "solid black" b creates a black border of any width c creates a black border 1 pixel wide
Answers: 1
question
Computers and Technology, 24.06.2019 17:00
Aman travel 200m towards east< br /> from his house then takes left< br /> to turn and moves 200 m north< br /> find the displacement & distance.< br />
Answers: 3
You know the right answer?
Consider the following class definitions: class bClass
{
public:
void setX(int);...
Questions
question
Mathematics, 09.03.2021 20:30
question
Mathematics, 09.03.2021 20:30
question
Mathematics, 09.03.2021 20:30
question
Chemistry, 09.03.2021 20:30
question
History, 09.03.2021 20:30
Questions on the website: 13722362