Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef _ADVANCED_USER_
- #define _ADVANCED_USER_
- #include "BasicUser.h"
- class AdvancedUser: public BasicUser{
- public:
- AdvancedUser(int newAge, const String& newName, bool newBlocked = false);
- virtual bool isAdvancedUser()const{ return true; }
- virtual bool updateBlockStatus(bool isBlocked, BasicUser* subject);
- virtual ~AdvancedUser(){}
- };
- #endif // _ADVANCED_USER_
- __________________________________________________
- #include "AdvancedUser.h"
- AdvancedUser::AdvancedUser(int newAge, const String& newName,
- bool newBlocked) :
- BasicUser(newAge, newName, newBlocked){}
- bool AdvancedUser::updateBlockStatus(bool isBlocked, BasicUser* subject){
- if (!subject){
- cerr << "Invalid user pointer." << endl;
- return false;
- }
- subject->blocked = isBlocked;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement