Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following class interfaces: class Teacher {public: Teacher(); Teach

ID: 3578224 • Letter: C

Question

Consider the following class interfaces: class Teacher {public: Teacher(); Teacher(string new_name); string get_name() const; private: String name;}; class MathsTeachcr: 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"); t_1 = 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? t1 = mt1 mt1 = t1 mt1 = mt2 t1 = t2

Explanation / Answer

Answer:

1) which of the preceding assignment statement in the function main() would slice away the data of the derived class object?

ANS: A t1=mt1

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote