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, 22.06.2019 01:20
What is the full meaning of rfid in computer
Answers: 2
question
Computers and Technology, 22.06.2019 21:40
Develop a function to create a document in the mongodb database “city” in the collection “inspections.” be sure it can handle error conditions gracefully. a. input -> argument to function will be set of key/value pairs in the data type acceptable to the mongodb driver insert api call b. return -> true if successful insert else false (require a screenshot)
Answers: 2
question
Computers and Technology, 23.06.2019 00:00
Donna and her team of five have invented a new gadget for the science exhibition in their college. which intellectual property right will protect their invention?
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 2
You know the right answer?
Consider the following class interfaces: class Teacher
{
public:
Teacher();
...
Questions
question
Mathematics, 22.03.2021 01:00
question
World Languages, 22.03.2021 01:00
question
History, 22.03.2021 01:00
Questions on the website: 13722367