-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPayroll.cpp
More file actions
38 lines (31 loc) · 1.63 KB
/
Copy pathPayroll.cpp
File metadata and controls
38 lines (31 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// ConsoleApplication7.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int main()
{
long empid[7] = { 5654588,4512520,7812295,8774177,8427571,1385205,754880 };
double hours[7];
double payRate[7];
double wage[7];
for (int i = 0; i < 7; i++)
{
do {
cout << "Please enter the hours for " << empid[i] << endl;
cin>>hours[i];
} while (hours[i] < 15 || isnan(hours[i]));
do {
cout << "Please enter the pay rate for " << empid[i] << endl;
cin >> payRate[i];
} while (isnan(payRate[i]));
wage[i] = payRate[i] * hours[i];
}
for (int j = 0; j < 7; j++)
{
cout << empid[j] << "\'s wages are " <<fixed<<setprecision(2)<< wage[j] << endl;
}
return 0;
}