subject

Consider the following class interfaces: class Teacher
{
public:
Teacher();
Teacher(string new_name);
string get_name() const;
private:
string name;
};
class MathsTeacher : public Teacher
{
public:
MathsTeacher();
MathsTeacher(string new_qualification, string new_name);
void display_data() const;
private:
string qualification;
};
int main()
{
Teacher t1, t2("John");
MathsTeacher mt1, mt2("TopLevel", "Sarah");
t1 = mt1;
t1 = t2;
mt1 = mc2;
mt1 = t1;
return 0;
}

Which one of the preceding assignment statements in the function main() would slice away the data of the derived class object?
A. c1 = ac1
B. c1 = c2
C. ac1 = ac2
D. ac1 = c1

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 17:20
What is the best assassins creed game?
Answers: 2
question
Computers and Technology, 24.06.2019 21:40
is on drugs i swear i ask a question and its not showing whats going
Answers: 2
question
Computers and Technology, 25.06.2019 05:30
In our new car, we were able to drive 30 miles in a half an hour. from this information, we can determine the car's a. acceleration. b. velocity. c. speed. d. direction.
Answers: 1
question
Computers and Technology, 25.06.2019 09:00
Janet has to prepare a presentation on business strategies for work. which guideline should she follow to create an effective presentation? a. use a readable font b. use a multicolored background c. use a small, but stylish font d. include detailed text
Answers: 1
You know the right answer?
Consider the following class interfaces: class Teacher
{
public:
Teacher();
...
Questions
question
Social Studies, 25.09.2019 02:00
question
Mathematics, 25.09.2019 02:00
question
Law, 25.09.2019 02:00
question
Mathematics, 25.09.2019 02:00
Questions on the website: 13722363