-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdec11.cpp
More file actions
61 lines (45 loc) · 1.52 KB
/
dec11.cpp
File metadata and controls
61 lines (45 loc) · 1.52 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
using namespace std;
struct PayRoll
{
int empNumber;
string name;
double hours;
double payRate;
double grossPay;
double grossPay_withTax;
};
int main()
{
const double TAX = 0.07;
PayRoll employees;
cout << "Enter the employee's number: " << endl;
cin >> employees.empNumber;
cout << "Enter employee's name: " << endl;
cin.ignore();
getline(cin, employees.name);
cout << "How many hours the employee worked: ";
cin >> employees.hours;
cout << "What's the employee payRate: ";
cin >> employees.payRate;
employees.grossPay = (employees.hours * employees.payRate);
cout << "======================================" << endl;
cout << "The employee's number is " << endl;
cout << employees.empNumber << endl;
cout << "The employee's name " << endl;
cout << employees.name << endl;
cout << "The employee worked: ";
cout << employees.hours << endl;
cout << "The employee pay rate is ";
cout << employees.payRate << endl;
cout << "The employee gross pay without tax is: ";
cout << employees.grossPay << endl;
employees.grossPay_withTax = employees.grossPay - (employees.grossPay * TAX);
cout << "The employee gross pay is: ";
cout << employees.grossPay_withTax << endl;
cout << "The employee gross pay after 2 weeks is: " << endl;
cout << employees.grossPay_withTax * 2 << endl;
}