Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- class Person
- {
- public:
- string password;
- string name;
- Person(): password("abcd"),name("X") {}
- void entry_dis()
- {
- cout<<"Enter your name: ";
- cin>>name;
- cout<<endl;
- cout<<"Enter your password: ";
- cin>>password;
- cout<<endl;
- }
- };
- class user : public Person
- {
- public:
- void welcome_user()
- {
- cout<<"Welcome to our portal User"<<endl;
- }
- };
- class admin : public Person
- {
- public:
- void welcome_admin()
- {
- cout<<"Welcome to our portal Admin"<<endl;
- }
- };
- int main()
- {
- Person noob;
- noob.entry_dis();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement