Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. #include<iostream>
  2. #include<vector>
  3.  
  4. using namespace std;
  5.  
  6. class Worker {
  7.   string first_name;
  8.   string second_name;
  9.  
  10.   public:
  11.     Worker(string first_name, string second_name) {
  12.       this->first_name = first_name;
  13.       this->second_name = second_name;
  14.     }
  15.    
  16.     string GetFirstName() const {
  17.       return this->first_name;
  18.     }
  19.    
  20.     string GetSecondName() const {
  21.       return this->second_name;
  22.     }
  23. };
  24.  
  25. ostream& operator<<(ostream& out, const Worker& worker) {
  26.   return out << worker.GetFirstName() << ' ' << worker.GetSecondName();
  27. }
  28.  
  29. void Execute() {
  30.   vector<Worker> workers;
  31.   //read from file
  32.   while (true) {
  33.     int choose;
  34.     cout << "Choose action\n";
  35.     cout << "1. Print workers\n";
  36.     cin >> choose;
  37.     switch (choose) {
  38.       case 1:
  39.         //print workers
  40.         break;
  41.       default:
  42.         cout << "Wrong choose\n";
  43.     }
  44.   }
  45. }
  46.  
  47. int main() {
  48.   Execute();
  49.  
  50.   return 0;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement