Develop a program in C++ that will determine the gross pay for each of several e
ID: 3620221 • Letter: D
Question
Develop a program in C++ that will determine the gross pay for each of several employees. The company pays "straight time" for the first 40 hours worked by each employee and pays "time-and-a-half" for all hours worked in excess of 40 hours. You're given a list of the employees of the company, the number of hours each employee worked last week and the hourly rate of each employee. Your program should input this information for each employee, and should determine and display the employee's gross pay. Here is a sample input/out dialog:Enter # of hours worked (-1 to end): 39
Enter hourly rate of the worker ($00.00): 10.00
Salary is $390.00
Enter # of hours worked (-1 to end): 40
Enter houly rate of the worker ($00.00): 10.00
Salary is $400.00
Enter # of hours worked (-1 to end): 41
Enter hourly rate of the worker ($00.00): 10.00
Salary is $415.00
Enter # of hours worked (-1 to end): -1
Explanation / Answer
// this program is not compiled, checked for syntax error or debuged. That is your job //to do. Just plug it into a compiler and see if it works. (the while (hours!=-1) might //throw a fit. (unsure) theoretically it should work. //also i feel that this program is self documented so i did not bother to add further //documentation. if you need more explanation, just ask away and ill answer. #include using namespace std; int main(void){ int hours = 0, rate = 0, salary; while(hours != -1) { cout > hours; cout > rate; if (hours 40) salary = (hours * rate) + ((hours - 40)*(rate/2); coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.