-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3_1.cpp
More file actions
48 lines (36 loc) · 1.11 KB
/
3_1.cpp
File metadata and controls
48 lines (36 loc) · 1.11 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
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class employee_salaries {
string employee_name;
double basic_salary, bonus_salary;
public:
employee_salaries(string name, double salary, double empbonus = 500.0) {
employee_name = name;
basic_salary = salary;
bonus_salary = empbonus;
}
inline double getsalary() {
return basic_salary + bonus_salary;
}
void getdata() {
cout << "Name: " << employee_name << endl;
cout << "Basic Salary: " << basic_salary << endl;
cout << "Bonus: " << bonus_salary << endl;
cout << "Total Salary: " << getsalary() << endl;
cout << "--------------------------" << endl;
}
};
int main() {
vector<employee_salaries> employees;
employees.emplace_back("Pushti", 5000);
employees.emplace_back("Reeva", 8000);
employees.emplace_back("Khushi", 4000);
cout << "Employee Salary Details:\n";
for (auto &emp: employees) {
emp.getdata();
}
cout<<"24ce052_pushti kansara";
return 0;
}