Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Make sure you using C- Program. Cheak my code. Why they arenot working. Please d

ID: 3671403 • Letter: M

Question

Make sure you using C- Program. Cheak my code. Why they arenot working. Please donot copy paste

#include<stdio.h>
int main(void)
{
/*Declare variable*/
float rate, salary;

int hours;
/*Prompt the user name to enter hours*/
printf( "Enter number of hours worked(-1 to end): ");
/*Read hours*/
scanf( "%d", &hours );
  
while(hours != -1)
{
/*Prompt the user to enter hourly rate*/
printf( " Enter hourly rate of the worker ($00.00): ");
/*read the rate*/
scanf( "%f", &rate );
/*Calculate salary*/
  
if (hours <= 40)
{
Salary = hours * rate
}
/*if hours worked is greater then 40*/
else
{
Salary = 40 * rate +(( hours - 40) * ( rate * 1.5 ));
}
/*Display the salary*/
printf( " Salary is $%.2f", salary );
printf( " Enter number of hours worked (-1 to end): ");
/*Read hours*/
scanf( "%d", &hours );
}
return 0;
system ("pause");

}

.20 (Salary Calculator) Develop a program that will determine the gross pay for each of several employces. The company pays "straight time" for the first 40 hours worked by cach employee and pays "time-and-a-half" for all hours worked in excess of 40 hours. You're given a list of the employ- ees 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 deter- mine and display the employee's gross pay. Here is a sample input/output 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 hourly 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

#include #include #include #include using namespace std; int main() { double totalSalary = 0; double salary; double extSalary; double hours; double rate; cout > hours; while( hours != -1) { cout > rate; if( hours
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote