Develop a C program not C++#include #include begins like and uses printf that wi
ID: 3652930 • Letter: D
Question
Develop a C program not C++#include #include begins like and uses printf that will determine the gross pay for each of several employees. The company pays "straight time" for the first 40 hours worked and time and a half for hours worked in excess of 40. Ask the user for # of hours worked and the hourly rate of the employee. If the user enters -1 for the hours worked, they are done entering employees. Also, print out the total number of overtime hours, total number of regular hours, the number of employees entered, and the average gross pay. Sample Execution: Enter # of hours worked( -1 to end): 39 Enter hourly rate of employee: 20.00 Salary is $780.00 Enter # hours worked( -1 to end): 40 Enter hourly rate of employee: 10.00 Salary is $400.00 Enter # hours worked( -1 to end): 41 Enter hourly rate of employee: 10.00 Salary is $415.00 Enter #hours worked( -1 to end): -1 You entered 3 employees. Total regular hours: 119 Total overtime hours: 1 Average Gross Pay: $531.67Explanation / Answer
#include /* Develop a C program that will determine the gross pay for each of several employees. The company pays "straight time" for the first 40 hours worked and time and a half for hours worked in excess of 40. Ask the user for # of hours worked and the hourly rate of the employee. If the user enters -1 for the hours worked, they are done entering employees. Also, print out the total number of overtime hours, total number of regular hours, the number of employees entered, and the average gross pay. Sample Execution: Enter # of hours worked( -1 to end): 39 Enter hourly rate of employee: 20.00 Salary is $780.00 Enter # hours worked( -1 to end): 40 Enter hourly rate of employee: 10.00 Salary is $400.00 Enter # hours worked( -1 to end): 41 Enter hourly rate of employee: 10.00 Salary is $415.00 Enter #hours worked( -1 to end): -1 You entered 3 employees. Total regular hours: 119 Total overtime hours: 1 Average Gross Pay: $531.67*/ int main(){ int hoursWorked=0, employees=0 ; int regHoursTot=0,overtimeTot=0; double rate=0,GrossPay=0,Salary=0; do{ printf(" Enter # of hours worked( -1 to end): "); scanf("%d",&hoursWorked); if(hoursWorked!=-1){ printf("Enter hourly rate of employee: "); scanf("%lf",&rate); employees++; if(hoursWorkedRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.