Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
66
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. #include <string>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. /*struct subject
  8.     {
  9.         string s_name;
  10.     };
  11. */
  12.  
  13.  
  14. class human
  15.     {
  16.         protected:
  17.         string *v_name;
  18.         string *v_surname;
  19.         string *v_patronymic;
  20.         string *v_sex;
  21.         int v_age;
  22.     };
  23.  
  24. class student:public human
  25.     {
  26.         protected:
  27.             int v_numb_kurs;
  28.             string *v_numb_grup;
  29.             //subject stud_subj[];
  30.         public:
  31.             student(string *,string *,string *,string *, int, int, string *);
  32.             student(void){};
  33.             ~student(void){};
  34.             void show_stud()
  35.                 {
  36.                     cout<<*v_name<<endl;
  37.                     cout<<*v_surname<<endl;
  38.                     cout<<*v_patronymic<<endl;
  39.                     cout<<*v_sex<<endl;
  40.                     cout<<v_age<<endl;
  41.                     cout<<v_numb_kurs<<endl;
  42.                     cout<<*v_numb_grup<<endl;
  43.                
  44.                 };
  45.        
  46.     };
  47. student::student(string *name,string *surname,string *patronymic,string *sex, int age, int numb_kurs, string *numb_grup)
  48.     {
  49.         *v_name=*name;
  50.         *v_surname=*surname;
  51.         *v_patronymic=*patronymic;
  52.         *v_sex=*sex;
  53.         v_age=age;
  54.         v_numb_kurs=numb_kurs;
  55.         v_numb_grup=numb_grup;
  56.     }
  57.  
  58.  
  59. void main()
  60.     {
  61.         string t1, t2, t3, t4;
  62.         int t5, t6;
  63.         string t7;
  64.         cout<<".................. "; cin>>t1;
  65.         cout<<".................. "; cin>>t2;
  66.         cout<<".................. "; cin>>t3;
  67.         cout<<".................. "; cin>>t4;
  68.         cout<<".................. "; cin>>t5;
  69.         cout<<".................. "; cin>>t6;
  70.         cout<<".................. "; cin>>t7;
  71.         student vasia(&t1,&t2,&t3,&t4,t5,t6,&t7);
  72.         vasia.show_stud;
  73.         cin.get();
  74.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement