Advertisement
Guest User

asd

a guest
Apr 8th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1. class EWallet{
  2. private:
  3.     string username;
  4.     string password;
  5.     string address;
  6.     int balance;
  7.    
  8. public:
  9.     //Setter!
  10.     void setUsername(string username){
  11.         this->username = username;
  12.     }
  13.     void setPassword(string password){
  14.         this->password = password;
  15.     }
  16.     void setAddress(string address){
  17.         this->address = address;
  18.     }
  19.     void setBalance(int balance){
  20.         this->balance = balance;
  21.     }
  22.    
  23.     //Getter!
  24.     string getUsername(){
  25.         return this->username;
  26.     }
  27.     string getPassword(){
  28.         return this->password;
  29.     }
  30.     string getAddress(){
  31.         return this->address;
  32.     }
  33.     int getBalance(){
  34.         return this->balance;
  35.     }
  36.    
  37.     void withdraw(int _Balance){
  38.         if(this->balance >= _Balance)
  39.         {
  40.             cout << this->balance;
  41.             this->balance -= _Balance;
  42.         }
  43.         else if(this->balance < _Balance){
  44.             cout << "Balance is not enough for withdrawal." << endl;
  45.         }
  46.     }
  47.    
  48.     void TopUpCash(int _Balance){
  49.         this->balance += _Balance;
  50.     }
  51. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement