A bank account system

The problem

Build a program that manages several kinds of bank account, with deposits, withdrawals, transfers, monthly interest and a statement for each account.

Requirements

Technologies

Step by step

  1. Write the abstract Account class with deposit, a pure virtual withdraw rule, and a transaction list.
  2. Write SavingsAccount and CurrentAccount, each with its own withdrawal rule and monthly update.
  3. Write the exception classes, deriving them from runtime_error, and throw them from the accounts.
  4. Write Bank, which owns Account pointers in a map from account number, deletes them in its destructor, and forbids copying.
  5. Add transfers between accounts, making sure a failed withdrawal leaves both balances unchanged.
  6. Write operator<< for statements, and a small command loop to drive the bank.
  7. Test overdrafts, transfers to a missing account, and many months of interest.

Expected result

A working bank system where each kind of account follows its own rules and every error is reported clearly.

How it is evaluated

Ways to improve it