A Moving to another question will save this response. Question 9 Based on the fo
ID: 3578619 • Letter: A
Question
A Moving to another question will save this response. Question 9 Based on the following declaration of the Sportsman class, and that Footballer ilherits fiom the Sportsman class. which of the followang are true? class Public Sportsman() Sportsman const string& name)s Sportsman (double salary) Sportsman (const string& name, double salary) void setName(const string& newName) string getName const; private string nanes double salary o A The Footballer class inherits name and salary, but Footballer functions can only change the values of the Eame data uaember by using the set O meanber function B A Footballer object has direct access to te Dame and salasy inhented data Emembers c The Footballer class does not inheritthe private data members. e D The Footballer class inherits name and salary, but Footballer functions cannot change the values ofeither data member 4 Moving to another question wil save this responseExplanation / Answer
1.Answer is a.
Option B is worong because FootBaller object can not direct access of private members of super class even though it is derived.
Option C is wrong because FootBaller class inherit all members and functions of class sportsman but cannot access private values
Option D is wrong because FootBaller class inherit all members and functions of class sportsman and can change also .
2. Answer are c,e
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.