Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class EWallet{
- private:
- string username;
- string password;
- string address;
- int balance;
- public:
- //Setter!
- void setUsername(string username){
- this->username = username;
- }
- void setPassword(string password){
- this->password = password;
- }
- void setAddress(string address){
- this->address = address;
- }
- void setBalance(int balance){
- this->balance = balance;
- }
- //Getter!
- string getUsername(){
- return this->username;
- }
- string getPassword(){
- return this->password;
- }
- string getAddress(){
- return this->address;
- }
- int getBalance(){
- return this->balance;
- }
- void withdraw(int _Balance){
- if(this->balance >= _Balance)
- {
- cout << this->balance;
- this->balance -= _Balance;
- }
- else if(this->balance < _Balance){
- cout << "Balance is not enough for withdrawal." << endl;
- }
- }
- void TopUpCash(int _Balance){
- this->balance += _Balance;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement