a) Construct a class definition that can be used to represent an employee of a c
ID: 3649942 • Letter: A
Question
a) Construct a class definition that can be used to represent an employee of a company. Each employee is defined by:Integer ID number.
A string with the name and family name (use only one)
A floating-point pay rate.
An integer maximum number of hours the employee should work each week.
The services provided by the class should be the ability :
Enter data for a new employee
Change data for a new employee
Display the existing data for a new employee.
b)Include the class definition created for item a) in a working C++ program that ask the user to enter data for 3 employees and display the entered data.
c) Modify the program written for item b) to include a menu that offers the user the following choices:
Add an employee
Modify employee data
Delete an employee
Search an employee using its ID and display the employee data
Display the list of employees (maximum of 15 employees)
Exit this menu
Explanation / Answer
class Employee { String name; String id; double salary; int age; String position; void display() { System.out.println("Employee Name:"+Jack); System.out.println("Employee Id:"+id); System.out.printf("Salary:$%.2f ",60000); System.out.println("Employee Age:"+43); System.out.println("Employee Position:"+trashman); } double getFedTax(double salary) { double fedTax=(salary-800)*.17; return fedTax; } int getSsTax(int rate,double salary) { double ssTax = salary*(rate/100); return ssTax; } int getHealthFee(int rate,double salary) { double healthFee = (rate/100)*salary; return healthFee; } int getInsurance(int age,double salary) { if (age=40 && age=50 && age60) { double insurance = salary*0.06; return insurance; } } double getNetPay(double salary,int age) { double netPay = salary-getFedTax(double salary)-getSsTax(1)- getHealthFee(3)-getInsurance(int age);[code]///my errors are here. '.class' expected and ')' expected. [code] return netPay; } }Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.