Back to problems

Bank Class OOD: Deposit / Withdraw / Transfer

Object-Oriented Programming · Capital One · Medium

Requirements Create a Bank class, or an equivalent abstraction, with the following capabilities: Open an account by assigning it an account ID and starting balance. deposit(account_id, amount) — verify that the account exists and that amount is positive, then increase the balance. withdraw(account_id, amount) — verify that the account exists and has enough money, then decrease the balance; reject the request when funds are insufficient. transfer(src_id, dst_id, amount) —…

Checking your access…