diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2020-06-27 14:11:01 +0300 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2020-06-27 14:11:01 +0300 |
| commit | f2d1216153123a3fbee6af8e7a0ad06a3577f216 (patch) | |
| tree | 2c5904a420306a4c742185557f10f158c1d39a1f /CPP/BABS/BankAccount.cpp | |
| parent | e4bc857f1f7edf677c3ffec8021db57043db350d (diff) | |
| download | Self-learning-f2d1216153123a3fbee6af8e7a0ad06a3577f216.tar Self-learning-f2d1216153123a3fbee6af8e7a0ad06a3577f216.tar.gz Self-learning-f2d1216153123a3fbee6af8e7a0ad06a3577f216.zip | |
Finished implementation of closing and opening bank accounts.
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 |
