Make sure use the C-Program only Develop a program that will determine the gross
ID: 3671387 • Letter: M
Question
Make sure use the C-Program only
Develop a program 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/output dialog:Explanation / Answer
#include <stdio.h>
int main()
{
int n;
double rate,salary;
while(1)
{
printf("Enter # of hours worked (-1 to end): ");
scanf("%d",&n);
if(n == -1)
break;
printf("Enter hourly rate of the worker ($00.00): ");
scanf("%lf",&rate);
if(n<=40)
salary = rate*n;
else
salary = rate*40+(rate*1.5)*(n-40);
printf("Salary is $%0.2lf ", salary);
}
return 1;
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.