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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!