Advertisement
Guest User

Untitled

a guest
May 20th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3. #include <map>
  4.  
  5. using namespace std;
  6.  
  7. class Student {
  8.  
  9. protected:
  10.  
  11.     string m_name;
  12.     int m_id;
  13.  
  14. public:
  15.  
  16.     const string &getName() const {
  17.         return m_name;
  18.     }
  19.  
  20.     void setName(const string &name) {
  21.         Student::m_name = name;
  22.     }
  23.  
  24.     int getId() const {
  25.         return m_id;
  26.     }
  27.  
  28.     void setId(int id) {
  29.         Student::m_id = id;
  30.     }
  31.  
  32. };
  33.  
  34. class HeadMan : public Student
  35. {
  36.  
  37. private:
  38.  
  39.     map <string, Student> m_listOfStudents; // список студентов с номерами телефонов
  40.     map <bool, Student> m_listOfMissing; // список посещеаемости на одну пару
  41.  
  42. public:
  43.  
  44.     const map<string, Student> &getListOfStudents() const {
  45.         return m_listOfStudents;
  46.     }
  47.  
  48.     void setListOfStudents(const map<string, Student> &listOfStudents) {
  49.         HeadMan::m_listOfStudents = listOfStudents;
  50.     }
  51.  
  52.     const map<bool, Student> &getListOfMissing() const {
  53.         return m_listOfMissing;
  54.     }
  55.  
  56.     void setListOfMissing(const map<bool, Student> &listOfMissing) {
  57.         HeadMan::m_listOfMissing = listOfMissing;
  58.     }
  59.  
  60. };
  61.  
  62. int main() {
  63.     std::cout << "Hello, World!" << std::endl;
  64.     return 0;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement