Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.12 KB | None | 0 0
  1. #include <string>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. class Human {
  7. public:
  8.     string name;
  9.     int age;
  10.     int number;
  11.     char gender;
  12.     Human();
  13.     Human(string newName, int newAge, int newNumber, char newGender) {
  14.         name = newName;
  15.         age = newAge;
  16.         number = newNumber;
  17.         gender = newGender;
  18.     }
  19.    
  20.     virtual void print(){
  21.         cout << "Name: " << name << endl;
  22.         cout << "Age: " << age << endl;
  23.         cout << "Number: " << number << endl;
  24.         cout << "Gender: " << gender << endl;
  25.     };
  26.     virtual ~Human();
  27. };
  28.  
  29.  
  30. class Student : public Human{
  31. public:
  32.     int course;
  33.     string university;
  34.     string faculty;
  35.  
  36.     Student(int newCourse, string newUniversity, string newFaculty) {
  37.         course = newCourse;
  38.         university = newUniversity;
  39.         faculty = newFaculty;
  40.     }
  41.     virtual ~Student();
  42. };
  43.  
  44. class FatherFamily : public Human {
  45. public:
  46.     FatherFamily();
  47.     Human *Wife;
  48.     int countChildren;
  49.     Human *count;
  50.     void addChild() {
  51.        
  52.     }
  53.     virtual ~FatherFamily();
  54.    
  55. };
  56.  
  57. class StudentFatherFamily : public Student, public FatherFamily {
  58. public:
  59.     StudentFatherFamily();
  60.     virtual ~StudentFatherFamily();
  61. };
  62.  
  63. int main() {
  64.    
  65.     return 0;
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement