diff options
Diffstat (limited to 'CPP/BABS/BankAccount.cpp')
| -rw-r--r-- | CPP/BABS/BankAccount.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/CPP/BABS/BankAccount.cpp b/CPP/BABS/BankAccount.cpp index 180f56c..ea02d87 100644 --- a/CPP/BABS/BankAccount.cpp +++ b/CPP/BABS/BankAccount.cpp @@ -14,6 +14,7 @@ BankAccount::BankAccount(int initialDeposit) { balance = initialDeposit; } + int BankAccount::getId() { return id; } @@ -22,6 +23,11 @@ int BankAccount::getBalance() { return balance; } +bool BankAccount::getCloseStatus() { + return closed; +} + + void BankAccount::deposit(int amount) { balance += amount; } @@ -35,9 +41,13 @@ int BankAccount::withdraw(int amount) { } std::string BankAccount::toString() { - return "ID: " + std::to_string(id) + " Balance: " + std::to_string(balance); + 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 |
