Advertisement
Guest User

Sample.01

a guest
Jan 28th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. class Person
  6. {
  7. public:
  8.     string password;
  9.     string name;
  10.  
  11.     Person(): password("abcd"),name("X") {}
  12.     void entry_dis()
  13.     {
  14.         cout<<"Enter your name: ";
  15.         cin>>name;
  16.         cout<<endl;
  17.         cout<<"Enter your password: ";
  18.         cin>>password;
  19.         cout<<endl;
  20.     }
  21. };
  22.  
  23. class user : public Person
  24. {
  25. public:
  26.     void welcome_user()
  27.     {
  28.         cout<<"Welcome to our portal User"<<endl;
  29.     }
  30. };
  31.  
  32. class admin : public Person
  33. {
  34. public:
  35.     void welcome_admin()
  36.     {
  37.         cout<<"Welcome to our portal Admin"<<endl;
  38.     }
  39. };
  40. int main()
  41. {
  42.     Person noob;
  43.     noob.entry_dis();
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement