diff options
Diffstat (limited to 'CPP/BABS/BankAccount.cpp')
| -rw-r--r-- | CPP/BABS/BankAccount.cpp | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/CPP/BABS/BankAccount.cpp b/CPP/BABS/BankAccount.cpp deleted file mode 100644 index ea02d87..0000000 --- a/CPP/BABS/BankAccount.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include <string> - -#include "BankAccount.h" - -int currId = 0; - -BankAccount::BankAccount() { - id = currId++; - balance = 0; -} - -BankAccount::BankAccount(int initialDeposit) { - id = currId++; - balance = initialDeposit; -} - - -int BankAccount::getId() { - return id; -} - -int BankAccount::getBalance() { - return balance; -} - -bool BankAccount::getCloseStatus() { - return closed; -} - - -void BankAccount::deposit(int amount) { - balance += amount; -} - -int BankAccount::withdraw(int amount) { - if (amount > balance) { - return -1; - } - balance -= amount; - return amount; -} - -std::string BankAccount::toString() { - return "ID: " + std::to_string(id) + " Balance: " + std::to_string(balance) + ((closed)?" CLOSED":""); -} - -void BankAccount::close() { - closed = true; -} - -void BankAccount::reopen() { - closed = false; -}
\ No newline at end of file |
