64 701
Assignments Done
99,4%
Successfully Done
In September 2018

Answer to Question #24295 in C++ for sarah

Question #24295
write a c++ program that will input employee name, rate per hour, number of hours worked and will compute the daily wage of an employee. if the number of hours worked exceeds eight hours add 30% to each excess hours as an overtime rate.
formula: daily wage=rate per hour x number of hours worked + OT pay.
Expert's answer
#include<iostream>
#include <string>
using namespace std;

int main() {
string name;
double rate, hours;
cout << "Enter employee name: ";
cin >> name;
cout << "Enter rate per hour: ";
cin >> rate;
cout << "Enter number of hours: ";
cin >> hours;
if (hours>8) {
cout << "Daily wage is:
";
cout <<
rate*hours+1.3*rate*(hours-8);
}
else {
cout << "Daily wage is:
";
cout << rate*hours;
}
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions