Question: Write a C++ program which uses the following arrays: empID : An array of 7 integers to hold employee identification numbers. The array should be
Write a C++ program which uses the following arrays:
empID: An array of 7 integers to hold employee identification numbers. The array should be initialized with the following values: 1, 2, 3, 4, 5, 6, 7.
Hours: an array of seven integers to hold the number of hours worked by each employee.
payRate: an array of seven doubles to hold each employees hourly pay rate.
Wages: an array of seven doubles to hold each employees gross salary.
The program should display each employee number and ask the user to enter that employees hours and pay rate. It should then calculate the gross wages for that employee (hours times pay rate) and store them in the wages array. After the data has been entered for all the employees, the program should display each employees identification number and gross wages.
Input validation: pay rate must be greater than or equal to $5 but less than or equal to $15
Input validation: hours worked must be greater than 0 but less than or equal to 40
Input validation: no garbage or blanks allowed for pay rate or hours worked
No global variables
No labels or go-to statements
No infinite loops, examples include:
for(;;)
while(1)
while(true)
do{//code}while(1);
No break statements to exit loops
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
