i need to create a program that displays weekly gross pay fo

i need to create a program that displays weekly gross pay for any number of employees. i should be about to input the number of hours worked and the hourly rate and if the employee worked more then 40 hours they need to get 1 and 1/2 times the pay. I had recieved an answer for this before but the program kept getting an error due to one of the variables in the code. it just needs to be simiple and actually work. when i fixed the error and ran the program it never showed the gross pay. just 0 everytime.

Solution

In the description its not specified what language its required so just providing in C++

#include<iostream.h>

#include<conio.h>

void main()

{ int gross, hour,rate,n;

cout<<\"Enter number of employees\";

cin>>n;

for (int = 1;i<=n;i++)

{

cout<<\"Enter number of hours worked\";

cin>>hour;

cout<<\"Enter the hourly rate\";

cin>>rate;

if(hours>=40)

gross = hour*rate*1.5;

else

gross = hour*rate;

}

}

i need to create a program that displays weekly gross pay for any number of employees. i should be about to input the number of hours worked and the hourly rate

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site