-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass15.cpp
More file actions
32 lines (31 loc) · 982 Bytes
/
class15.cpp
File metadata and controls
32 lines (31 loc) · 982 Bytes
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
#include <iostream>
#include <string>
using namespace std;
int main() {
int employeeid, salary, yearsofexperience;
string name;
cout<< "Enter employee ID: ";
cin >> employeeid;
cout << "Enter employee name: ";
cin >> name;
cout << "Enter employee salary: ";
cin >> salary;
cout <<"Enter years of experience: ";
cin >> yearsofexperience;
int a;
int totalSalary = salary + (yearsofexperience * a);
if (yearsofexperience <2) {
a= 0.05 * salary;
}
else if (yearsofexperience >= 2 && yearsofexperience < 5) {
a = 0.10 * salary;
} else {
a = 0.15 * salary;
}
cout << "Employee ID: " << employeeid << endl;
cout << "Employee Name: " << name << endl;
cout << "Employee Salary: " << salary << endl;
cout << "Years of Experience: " << yearsofexperience << endl;
cout << "Total Salary after increment: " << totalSalary << endl;
return 0;
}