Computers and Technology

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;

}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 05:00, 420420blazee
Are special characters that allow you to search for multiple words at the same time.
Answers: 2
image
Computers and Technology, 22.06.2019 21:00, daniella0123
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings starting from index 0. for each match, add one point to userscore. upon a mismatch, exit the loop using a break statement. assume simonpattern and userpattern are always the same length. ex: the following patterns yield a userscore of 4: simonpattern: rrgbryybgy userpattern: rrgbbrybgy
Answers: 2
image
Computers and Technology, 23.06.2019 06:30, jayjay5246
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
image
Computers and Technology, 23.06.2019 15:00, abelxoconda
1. which of the following statements are true about routers and routing on the internet. choose two answers. a. protocols ensure that a single path between two computers is established before sending packets over it. b. routers are hierarchical and the "root" router is responsible for communicating to sub-routers the best paths for them to route internet traffic. c. a packet traveling between two computers on the internet may be rerouted many times along the way or even lost or "dropped". d. routers act independently and route packets as they see fit.
Answers: 2
Do you know the correct answer?
Consider the following class definitions: class bClass
{
public:
void setX(int);...

Questions in other subjects:

Konu
Mathematics, 21.12.2019 15:31
Konu
Mathematics, 21.12.2019 15:31
Konu
Mathematics, 21.12.2019 15:31
Konu
Mathematics, 21.12.2019 15:31