January 2020
Intermediate to advanced
532 pages
13h 31m
English
As part of a new initiative, the bank wants us to support a new savings account product, which provides daily interest for customers. Since the existing account management's functionality is critical to the bank's business and is maintained by a different team, we have decided to reuse its functionality without touching any of the existing source code.
First, let's create our own SavingsAccount data type, as follows:
struct SavingsAccount acct::Account interest_rate::Float64 SavingsAccount(account_number, balance, date_opened, interest_rate) = new( Account(account_number, balance, date_opened), interest_rate )end
The first field, acct, is used to hold an Account object, while the second ...
Read now
Unlock full access