Write a program to calculate the stores weekly payroll


A bookstore owner wants you to write a program to calculate the store's weekly payroll. The store's employees are paid hourly. Overtime is to be paid at the rate of 1.5 times the normal rate for hours an employee worked over 40. The program should prompt the user to enter the number of hours the employee worked and the pay rate for the employee. The program should display the regular pay, overtime pay, and gross pay for that employee. Then the program should prompt the user to enter the data for another employee. When the user responds that there are no more employees to process, the program should display the number of employees it processed and the total payroll, that is, the sum of the gross salaries of the employees.

The program should validate the pay rate as it is entered. The only valid hourly pay rates are the following: 5.50, 6.00, 6.50, 6.75, 7.00, 7.25, 7.50, 7.75, 8.00. Store the rates in an array. When a pay rate is entered, search the array for a match. If there is a match, continue the rest of the calculations. If there is no match, display an error message, a list of the valid pay rates, and prompt for another pay rate.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Write a program to calculate the stores weekly payroll
Reference No:- TGS0146274

Expected delivery within 24 Hours