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, 22.06.2019 04:30
Dr. wisteria is a prominent chiropractor in the chicago area. she wants to provide a forum for her patients to discuss their health concerns and to seek and offer advice to other patients. which telecommunications tool is most appropriate for dr. wisteria's needs?
Answers: 3
question
Computers and Technology, 22.06.2019 22:40
When you type the pwd command, you notice that your current location on the linux filesystem is the /usr/local directory. answer the following questions, assuming that your current directory is /usr/local for each question. a. which command could you use to change to the /usr directory using an absolute pathname? b. which command could you use to change to the /usr directory using a relative pathname? c. which command could you use to change to the /usr/local/share/info directory using an absolute pathname? d. which command could you use to change to the /usr/local/share/info directory using a relative pathname? e. which command could you use to change to the /etc directory using an absolute pathname? f. which command could you use to change to the /etc directory using a relative pathname?
Answers: 3
question
Computers and Technology, 23.06.2019 00:50
Representa os dados de um banco de dados como uma coleç? o de tabelas constituídas por um conjunto de atributos, que definem as propriedades ou características relevantes da entidade que representam. marque a alternativa que representa o modelo descrito no enunciado. escolha uma:
Answers: 3
question
Computers and Technology, 23.06.2019 19:00
This question involves a class named textfile that represents a text file. public class textfile { private string filename; private string filename; private arraylist words; // constructors not shown // postcondition: returns the number of bytes in this file public int filesize() { } // precondition: 0 < = index < words.size() // postcondition: removes numwords words from the words arraylist beginning at // index. public void deletewords(int index, int numwords) { } // precondition: 0 < = index < = words.size() // postcondition: adds elements from newwords array to words arraylist beginning // at index. pub lic voidaddwords(int index, string[] newwords) { } // other methods not shown } complete the filesize() method. the filesize() is computed in bytes. in a text file, each character in each word counts as one byte. in addition, there is a space in between each word in the words arraylist, and each of those spaces also counts as one byte. for example, suppose the words arraylist stores the following words: { mary had a little lamb; its fleece was white as snow. } the filesize() method would compute 4 + 3 + 1 + 6 + 5 + 4 + 6 + 3 + 5 + 2 + 5 as the sum of the lengths of each string in the arraylist. the value returned would be this sum plus 10, because there would also be 10 spaces in between the 11 words. complete the filesize() method below: // postcondition: returns the number of bytes in this file public int filesize() { }
Answers: 1
You know the right answer?
What is the output of the program?
#include
using namespace std;
class bclass
Questions
question
Mathematics, 16.04.2020 23:53
question
Mathematics, 16.04.2020 23:53
question
Mathematics, 16.04.2020 23:53
question
Mathematics, 16.04.2020 23:53
question
Mathematics, 16.04.2020 23:53
Questions on the website: 13722359