Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <iostream>
- using namespace std;
- class human
- {
- public:
- char name[50];
- int age;
- int number;
- char gender;
- virtual void methodprint()
- {
- cout << "\nName of human is " << name << endl << "The age of human is " << age << "\nThe doc number of human is " << number << endl << "\nThe gender of human is " << gender << endl;
- cout << endl;
- }
- };
- class student:public human
- {
- public:
- int course;
- char universitet[50];
- char facultet[50];
- virtual void methodprint()
- {
- cout << "\nCourse of student is " << course << endl << "\nUniversitet of student is " << universitet << endl << "\nFacultet of student is " << facultet << endl;
- }
- };
- class papa :public human
- {
- public:
- char wife;
- int children;
- };
- int main()
- {
- char name[50];
- int age;
- int number;
- char gender;
- cout << "Enter name of human:";
- cin >> name[50];
- human(name)=name;
- cout << "Enter age:" << endl;
- cin >> age;
- human(age)=age;
- cout << "Enter number:" << endl;
- cin >> number;
- human(number)=number;
- cout << "Enter age:" << endl;
- cin >> gender;
- human(gender)=gender;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement