Question
Question 2: You are required to write program for a local business the calculates the salaries of the employees. There are three types of employees
Question 2:
You are required to write program for a local business the calculates the salaries of the employees. There are three types of employees hourly, daily wagers and permanent ones. Hourly wagers are paid $32 per hour, daily wagers are paid $180 per day while permanent employees are paid a fixed salary of $4200 per month with a deduction of $120 for each day off.
- Write a class Salary with overload constructors i.e., one for each employee type. [10 Marks]
Data Members:
Int hour, Int day, Int Offdays
Member functions:
Int Calculatehourly()
Int CalculateDaily()
Int CalculatePermanent()
Getters/Setters for all data members of the class Salary
- Write a class employee with the following data members and member functions: [5 Marks]
Data Members:
Int emoId
String empName
String empType
Salary empSalary
Member functions:
Employee(int, String, String)
displayempInfo()
Write a main method to test employee class and call displayempInfo method to print all details of employees i.e. empName, empType and Salary etc.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started