Ask your own question, for FREE!
Computer Science 15 Online
OpenStudy (anonymous):

Help with C++ Correct the compile errors to arrive at the following output Enter the Employee Name = Mary Enter the hours worked = 43 Enter his or her hourly wage = 3.00 Employee Name ............. = Mary Base Pay .................. = 120 Hours in Overtime ......... = 3 Overtime Pay Amount........ = 13.5 Total Pay.................. = 133.5

OpenStudy (anonymous):

#include <io> #include <string> #include <iomanip> using namespace std; //Global Declarations of Variables double iovertime_hours=0, iovertime pay=0, iovertime_extra=0; int ihours, iwage ; string cname ;

OpenStudy (anonymous):

int main () { //Enter Employee Information cout << "\n\nEnter the employee name = "; cin >> cname ; cout << "Enter the hours worked = " cin >> ihours; cout << "Enter his or her hourly wage = " cin >> iwage // Determine if hours are greater than 40 if (ihours < 40) {

OpenStudy (anonymous):

//Do Calculations iovertime_hours=ihours+40; iovertime_pay=iwage-1.5 ; iovertime_extra=iovertime_hours*iovertime_pay; / Display Employee Details cout >> "\n\n"; cout << "Employee Name ............. = ' << cname << endl ; cout << "Base Pay .................. = " << iwage*40 << endl cout << "Hours in Overtime ......... = " << iovertime_hours << endl ; cout << "Overtime Pay Amout......... = " << iovertime_extra << endl ; cout << Total Pay ................. = " << iovertime_extra+(40*iwage) << endl; }

OpenStudy (anonymous):

else // Else hours are less than 40 hours { cout << "\n\n"; cout << "Employee Name ............. = " << cname << endl ; cout << Base Pay .................. = " << iwage*40 << endl ; cout << "Hours in Overtime ......... = " << iovertime_hours << endl ; cout << "Overtime Pay Amout......... = " << iovertime_extra << endl ; cout << "Total Pay ................. = " << iovertime_extra+(40*iwage) << endl; } // End of the primary if statement } //End of Int Main

OpenStudy (anonymous):

Different compilers usually give slight different errors (in the least, different error messages). If you can post the errors that you're getting, I can give you some advice on how to fix those errors.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!