Based on the following declaration of the Employee class, and that Manager inherits from the Employee class, which of the following are true? class Employee { public: Employee(); Employee (string new_name); Employee (double new_salary); Employee(string new_name, double new_salary); void set_name (string new_name); string get_name() const; private: }; string name; double salary; The Manager class does not inherit the private data members. A Manager object has direct access to the name and salary inherited data members. The Manager class inherits name and salary, but Manager functions cannot change the values of either data member. O The Manager class inherits name and salary, but Manager functions can only change the values of the name data member.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 5RQ
icon
Related questions
Question
C++
Based on the following declaration of the Employee class, and that Manager
inherits from the Employee class, which of the following are true?
class Employee
{
public:
Employee();
Employee(string new_name);
Employee (double new_salary);
Employee (string new_name, double new_salary);
void set_name(string new_name);
string get_name () const;
private:
};
string name;
double salary;
The Manager class does not inherit the private data members.
A Manager object has direct access to the name and salary inherited data
members.
O The Manager class inherits name and salary, but Manager functions cannot
change the values of either data member.
O The Manager class inherits name and salary, but Manager functions can only
change the values of the name data member.
Transcribed Image Text:Based on the following declaration of the Employee class, and that Manager inherits from the Employee class, which of the following are true? class Employee { public: Employee(); Employee(string new_name); Employee (double new_salary); Employee (string new_name, double new_salary); void set_name(string new_name); string get_name () const; private: }; string name; double salary; The Manager class does not inherit the private data members. A Manager object has direct access to the name and salary inherited data members. O The Manager class inherits name and salary, but Manager functions cannot change the values of either data member. O The Manager class inherits name and salary, but Manager functions can only change the values of the name data member.
Expert Solution
steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Knowledge Booster
Software Development
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr