Question: C++ please Input Validation This program is a basic payroll program. (1) Modify the program to include a loop that provides input validation on the

C++ please

Input Validation

This program is a basic payroll program.

(1) Modify the program to include a loop that provides input validation on the number of hours worked. Hours worked must be between 10 and 40 hours. (5 pts)

Example output if the user enters 45, 8, and 30 for hours worked (in that order) and 8.5 for pay rate.

Enter hours worked: 45 Hours must be between 10-40. Re-enter hours worked: 8 Hours must be between 10-40. Re-enter hours worked: 30 Enter pay rate: 8.5 Your pay is $255. 

(2) Modify the program to include a loop that provides input validation on the pay rate. Pay rate must be between $7.25 and $15. (5 pts)

Example output if the user enters 30 for hours worked and 18, 5, and 8.5 for pay rate (in that order).

Enter hours worked: 30 Enter pay rate: 18 Pay rate must be between $7.25 - $15. Re-enter pay rate: 5 Pay rate must be between $7.25 - $15. Re-enter pay rate: 8.5 Your pay is $255.

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!