subject
Computers and Technology, 24.12.2019 19:31 gg808

What is the output of the program?
#include
using namespace std;
class bclass
{
public:
a. void print() const;
bclass(int a = 0, int b = 0);
//postcondition: x = a; y = b;
private:
int x;
int y;
};
class dclass: public bclass
{
public:
b. void print() const;
dclass(int a = 0, int b = 0, int c = 0);
//postcondition: x = a; y = b; z = c;
private:
int z;
};
int main()
{
bclass bobject(2, 3);
dclass dobject(3, 5, 8);
bobject. print();
cout < < endl;
dobject. print();
cout < < endl;
return 0 ;
}
c. void bclass: : print() const
{
cout < < x < < " " < < y < < endl;
}
bclass: : bclass(int a, int b)
{
x = a;
y = b;
}
d. void dclass: : print() const
{
bclass: : print(); //added second colon
cout < < " " < < z < < endl;
}
dclass: : dclass(int a, int b, int c)
: bclass(a, b)
{
z = c;
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:10
Is the following an example of social media viral marketing? indicate your response by selecting yes or no. when you sign onto your favorite social networking website, you get messages from friends who have seen a television show they thought was a "must see! "
Answers: 1
question
Computers and Technology, 23.06.2019 06:40
How many nibbles can be stored in a 16-bit word?
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
How do i get rid of my member ship for
Answers: 2
question
Computers and Technology, 24.06.2019 13:50
Write a program that performs a simple n-body simulation, called "jumping leprechauns." this simulation involves n leprechauns, numberd 1 to n. it maintains a gold value g_i for each leprechaun i, which begins with each leprechaun starting out with a million dollars worth of gold, that is, g_i = 1000000 for each i = 1,. in addition, the simulation also maintains, for each leprachaun,i, a place on the horizon, which is represented as a double-precision floating point number, x_i. in each iteration of the simulation, the simulation processes the leprachauns in order. processing a leprachaun i during its iteration begins by computing a new place on the horizon for i, which is determined by the assignment:
Answers: 3
You know the right answer?
What is the output of the program?
#include
using namespace std;
class bclass
Questions
question
Mathematics, 01.10.2021 09:10
question
Social Studies, 01.10.2021 09:10
question
Mathematics, 01.10.2021 09:10
question
Mathematics, 01.10.2021 09:20