Write a C++ program that uses the class SalariedEmployee. The program is to defi
ID: 3683205 • Letter: W
Question
Write a C++ program that uses the class SalariedEmployee. The program is to define a derived class called Administrator, which is to be deried from SalariedEmployee. You are to supply the following data and function members in the Adminstrator class: A member variable of type string that contains the administrator's title(e.g., Director, Vice President). A member variable of type string that contains the company area of responsibility(e.g., Production, Accounting). A member variable of the type string that contains the name of the administrator's immediate supervisor. A protected member variable of type double that holds the administrator's annual salary(if the salaryy is for an administrator, the salary is kept in this variable, not the salary variable in the Salariedemployee class). A member function that returns each of the variables above. A member function which sets each of the variables above. A member function called print, which outputs the object's data to the screen. The SalariedEmployee class is to contain the following: Member variables containing the following data: name, ssn, netPay, wageRate, hours, department(the variable wagePay and hours are to be set to private). A member function that returns each of the variables above. A member function which sets each of the variables above.
Write a C++ program which instantiates employee and administrators(at least 5 employees and 2 administrators). Write a user interface with a menu to make it easy for the user to enter data into the objects. Then, once the data is entered, give the user options to change any data for an employee or administrator; and to print an employee's check with the information that was input(name, ssn, netPay, hours, wageRate, hours worked), along with the current date.
Explanation / Answer
#include #include class employee { int emp_num; char emp_name[20]; float emp_basic; float sal; float emp_da; float net_sal; float emp_it; public: void get_details(); void find_net_sal(); void show_emp_details(); }; void employee :: get_details() { coutemp_num; coutemp_name; coutemp_basic; } void employee :: find_net_sal() { emp_da=0.52*emp_basic; emp_it=0.30*(emp_basic+emp_da); net_sal=(emp_basic+emp_da)-emp_it; } void employee :: show_emp_details() { coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.