View the step-by-step solution to:

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...

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.

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question