2) Consider the code below: Employee class: class Employee { public: Employee(st
ID: 3699996 • Letter: 2
Question
2) Consider the code below: Employee class: class Employee { public: Employee(string theName, float thePayRate); protected string getName0 const; float getPayRate() const; float pay(float hours Worked) const; private string name; float payRate; Definitions for some of the methods follow: Employee:Employee(string theName, float thePayRate) name- theName; payRate- thePayRate; float Employee::pay(float hours Worked) const return hours Worked * payRate; Manager Class: #include "employee.h" class Manager : public Employee { public: Manager(string theName, float thePayRate, bool isSalaried); protected: bool getSalaried(0 const; float pay (float hours Worked) const;Explanation / Answer
A.) If pay() method id declared as virtual then the output will be-
Pay : 1000
Pay: 48000
(c) Employee pay() will be called in this case and the answer will be - Pay :1000
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.