Question: Payroll Decision Program Read the problem specification, design your solution, create and test your program. Submit your design work file, your source code file, and
Payroll Decision Program Read the problem specification, design your solution, create and test your program. Submit your design work file, your source code file, and your output files.
Programming Assignment:
Using Selection Control statements Problem Specification: Employee Payroll Calculation The WorkHard Corporation needs a program to calculate weekly wages for each employee. The user will enter the employee's name, ID.Number, hours worked, and job classification. Regular number of hours worked: 40 hours 1. The job classification of each employee determines the employee's hourly rate. The classifications are as follows: Classification Hourly_Rate 1 5.50 2 6.00 3 7.00 4 9.00 5 12.00 (use a switch statement) When an invalid Classification Type is entered, the hourly rate from classification type 1 is to be used to calculate the employee's wages and an appropriate message is to be printed after the calculated output. 2. Calculate regular pay: (use a two-way if statement) When an employee works the regular number of hours: regular_hours * hourly_rate When an employee works more than the regular number of hours: regular_hours * hourly_rate When an employee works less than the regular number of hours: hours_worked * hourly_rate 3. Calculate overtime pay: (use a two-way if statement) An employee is paid 1.5 times their regular hourly rate for all hours worked over the regular hours, otherwise, the overtime rate is 0. When an employee works more than the regular number of hours: (hours_worked - regular_hours) * 1.5 * hourly_rate 4. An appropriate message is to be generated for any employee who works less than 40 hours or more than 60 hours. Examples: Inadequate number of hours worked! or Excessive number of hours Worked! This message is to be printed after the calculated output. (Use one-way if statements) Input to this Program: 1. The Employee's Name (First & Last). 2. The Employee's Id. Number. 3. The Employee's Job Classification Number. 4. The Number of Hours Worked. Output From This Program:1. All User Input. 2. Number of Overtime Hours. 3. Hourly Rate. 4. Total Amount to be paid to the Employee. 5. Any message that was generated. Sample Output: WorkHard Corporation ==================== Employee Name: James Primer ID. Number: 77321 Job Classification: 2 Hourly Rate: 6.00 Total Hours Worked: 45 Overtime Hours: 5 Regular Pay: 240.00 Overtime Pay: 45.00 Total Earnings ......... $285.00 WorkHard Corporation ==================== Employee Name: Steve Blaise ID. Number: 87321 Job Classification: 7 Hourly Rate: 5.50 Total Hours Worked: 45 Overtime Hours: 5 Regular Pay: 220.00 Overtime Pay: 41.25 Total Earnings ......... $261.25 *** The Employee's Job Classification is in error *** The following input is to be used for the program results to be handed in: Name Id.Number Job Classification Hours Worked 1. James Primer 77321 2 45 2. Dave Thrift 78821 5 25 3. Jane Wax 88321 3 70 4. Marie Bonk 83821 8 80 Run the program once for each set of input, print each output file, hand in all four sets of output with your program and design work
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
