forked from ISUCT/Exam_1_147_2020
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Exam.cpp
41 lines (40 loc) · 1.14 KB
/
Exam.cpp
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
#include <iostream>
#include<cstring>
using namespace std;
class Work
{
string surname;
int experience, salaryh, hours, salary;
public:
void SetWorkStat(string sn, int exp, int sh, int h)
{
surname = sn;
experience = exp;
salaryh = sh;
hours = h;
int s;
s = sh * h;
salary = s;
}
void GetWorkStat()
{
cout << surname << endl << "Experience is " << experience << endl << "Hourly salary is " << salaryh << endl << "Number of hours " << hours << " hours" << endl << "The total salary " << salary << endl;
}
};
int main()
{
string surname;
int experience, salaryh, hours, salary;
cout << "Enter surname: ";
cin >> surname; cout << endl;
cout << "Enter experience: ";
cin >> experience; cout << endl;
cout << "Enter hourly salary: ";
cin >> salaryh; cout << endl;
cout << "Enter number of hours " << surname << " has worked: ";
cin >> hours; cout << endl;
Work resultWork;
resultWork.SetWorkStat(surname, experience, salaryh, hours);
resultWork.GetWorkStat();
return 0;
}