Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.73 KB | None | 0 0
  1. #ifndef __EMPLOYEE_H__
  2. #define __EMPLOYEE_H__
  3. # include <string>
  4. #include <iostream>
  5. #include <sstream>
  6. #include <stdio.h>
  7. using namespace std;
  8.  
  9. class Employee{
  10.     public:
  11.     string name;
  12.     string Position;
  13.     int Age;
  14.  
  15.     Employee(string new_name = "Undefined", string new_pos = "Undefined", int new_Age = 0)
  16.     {
  17.         name = new_name;
  18.         Position = new_pos;
  19.         Age = new_Age;
  20.     }
  21.     ~Employee() { };
  22.     string Show()
  23.     {
  24.         stringstream s;
  25.         s<< "name: " << this->name << ", position: " << this->Position << ", age: " << this->Age;
  26.         return s.str();
  27.     }
  28.     friend ostream& operator << (ostream& o, const Employee& x)
  29.     {
  30.         return o << "name: " << x.name << ", position: " << x.Position << ", age: " << x.Age;
  31.     }
  32. };
  33.  
  34. #endif /* __EMPLOYEE_H__ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement