Advertisement
Guest User

Untitled

a guest
May 24th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #ifndef _ADVANCED_USER_
  2. #define _ADVANCED_USER_
  3. #include "BasicUser.h"
  4.  
  5. class AdvancedUser: public BasicUser{
  6. public:
  7. AdvancedUser(int newAge, const String& newName, bool newBlocked = false);
  8.  
  9. virtual bool isAdvancedUser()const{ return true; }
  10.  
  11. virtual bool updateBlockStatus(bool isBlocked, BasicUser* subject);
  12.  
  13. virtual ~AdvancedUser(){}
  14. };
  15.  
  16. #endif // _ADVANCED_USER_
  17.  
  18. __________________________________________________
  19.  
  20. #include "AdvancedUser.h"
  21.  
  22. AdvancedUser::AdvancedUser(int newAge, const String& newName,
  23. bool newBlocked) :
  24. BasicUser(newAge, newName, newBlocked){}
  25.  
  26. bool AdvancedUser::updateBlockStatus(bool isBlocked, BasicUser* subject){
  27. if (!subject){
  28. cerr << "Invalid user pointer." << endl;
  29. return false;
  30. }
  31. subject->blocked = isBlocked;
  32. return true;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement