Advertisement
mostlabs

2.3/1

Dec 22nd, 2020 (edited)
858
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.45 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. #include<string>
  4.  
  5. using namespace std;
  6.                      //Отдел кадров.
  7. class human {
  8.  
  9. protected:
  10.  
  11.     string name, surname, sex, age;
  12.  
  13.  
  14.  
  15. public:
  16.     human(std::string name, string surname, string sex, string age) : name(name), surname(surname), sex(sex), age(age)
  17.     {
  18.  
  19.     }
  20.     string getName() { return name; }
  21.     string getSurname() { return surname; }
  22.     string getSex() { return sex; }
  23.     string getAge() { return age; }
  24.  
  25.  
  26. };
  27.  
  28.  
  29. class graduated {
  30.  
  31. protected:
  32.  
  33.     string education;
  34. public:
  35.     graduated(string education) : education(education)
  36.     {
  37.  
  38.     }
  39.     string getEducation() { return education; }
  40.  
  41. };
  42.  
  43. class references : public human , public graduated
  44. {
  45.  
  46. private:
  47.     string experince;
  48. public:
  49.     references(string name, string surname, string sex, string age, string education, string experince)
  50.         :human(name, surname, sex, age), graduated(education), experince(experince){
  51.     }
  52.  
  53.  
  54.  
  55.     string getExperince(){ return experince; }
  56.  
  57.     string info() {
  58.  
  59.         string  text = "name-" + name + " " + "surname-" + surname + " " + "sex-" + sex + " " + "age-" + age + " " + "education-" + education + " " + "experince-" + experince + " " +"year";
  60.        
  61.    
  62.         return text;
  63.  
  64.     }
  65.  
  66.  
  67. };
  68.  
  69.  
  70. int main() {
  71.    
  72.     references a("alpay", "pasali", "male", "20", "KurskStateUniversity", "2");
  73.     cout << a.info() << endl;
  74.  
  75.     system("pause");
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement