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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 15:00, anishivaturi123
Convert the quartstogallons class to an interactive application. instead of assigning a value to the number of quarts, accept the value from the user as input.
Answers: 2
image
Computers and Technology, 23.06.2019 20:10, banna01man
Leo is a recruitment executive for a large company. he has identified new labor resource requirements in both the marketing and production departments. what should be his first step in recruiting candidates for the positions? a. conduct background checks of candidates b. make job offers c. arrange interviews d. conduct reference checks e. place job ads on job sites
Answers: 1
image
Computers and Technology, 23.06.2019 21:00, shawnnoteman1234
Which task uses a simple parameter?
Answers: 1
image
Computers and Technology, 24.06.2019 10:10, juliana0122
Scanning the road can be thought of as a
Answers: 2
You know the right answer?
Consider the following class interfaces: class Teacher
{
public:
Teacher();
...

Questions in other subjects: