Write a program to prompt the user for hours and rate per hour using input to compute gross pay. Pay the hourly rate for the hours up to 40 and 1.5 times the hourly rate for all hours worked above 40 hours. Use 45 hours and rate of 10.50 per hour to test the program
Answers
Answered by
0
Answer:
Note: I am using C++ programming language.
#include<iostream>
using namespace std;
int main () {
float gross_pay = 0 ,hour ,extra_hour;
cout<<"*Enter work hours : " ;
cin>>hour ;
extra_hour = hour - 40 ;
cout<<"Extra hour " <<extra_hour ;
if(hour <= 40 ) {
gross_pay = hour * 10.50 ;
}
else {
gross_pay = hour * 10.50 ;
gross_pay += extra_hour * (10.50 * 1.5) ;
}
cout<<"\nThe Gross Pay is " <<gross_pay ;
return 0;
}
**Please follow me and mark this ans as Branliest answer.Thank you!
Similar questions