Purchase Solution

Overtime pay compile errors

Not what you're looking for?

Ask Custom Question

Use the following code to complete your Overtime Pay Compile Errors assignment.

#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 ;

int main ()
{
//Enter Employee Information
cout << "nnEnter 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)
{
//Do Calculations
iovertime_hours=ihours+40;
iovertime_pay=iwage-1.5 ;
iovertime_extra=iovertime_hours*iovertime_pay;

/ Display Employee Details
cout >> "nn";
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;
}
else // Else hours are less than 40 hours
{
cout << "nn";
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

THE OUTPUT SHOULD BE:

• Sample 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

Purchase this Solution

Solution Summary

The overtime pay compile errors are examined.

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Javscript Basics

Quiz on basics of javascript programming language.