Question: Write a complete syntactically correct C++ program that declares an array called pay_rates of type float with size 10 and a counter initialized to 0.
Write a complete syntactically correct C++ program that declares an array called pay_rates of type float with size 10 and a counter initialized to 0. The program should display a message as follows:
Do you have any payroll pay rates to enter (y or n)?
The program should then enter a while loop that runs until the user has answered using a character different from 'y'. In the loop, display a message as follows:
Enter employee pay rate:
The program should then read a number from the keyboard into the array using the counter as array subscript and increase the counter by 1 after the input. Next, display the message:
Any more payroll pay rates to enter (y or n)?
After the while loop, write a for loop that uses a variable from 0 to counter-1. In the for loop, use the loop variable to subscript the array and compute pay = current pay rate X 40. Display the pay to 2 decimal places as follows:
This week employee loop_variable+1 is paid xxxx.xx
where xxxx.xx is replaced by the actual number.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
