Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstring>
- #include<iomanip>
- using namespace std;
- class Employee
- {
- public:
- Employee(string first,string last, double hours,double salary)
- {
- name.first=first;
- name.last=last;
- work.hours=hours;
- work.salary=salary;
- }
- double FindAllSalary()
- {
- double result = work.hours*work.salary;
- return result;
- }
- private:
- struct
- {
- string first;
- string last;
- }name;
- struct
- {
- double hours;
- double salary;
- }work;
- };
- int main()
- {
- Employee employee("Ivan","Ivanov",8,20);
- cout<<employee.FindAllSalary();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement