Mixed data: bank accounts
posted by: Ms. Martin
21 September 2010
No Comment
A bank offers two kinds of accounts: checking and savings. Checking accounts contain a customer’s name and current balance. Savings accounts contain a customer’s name, current balance, and the number of withdrawals made so far this month.
- Develop data definitions for accounts. Provide examples for every define-struct that you write (you will write more than one).
- Write a function
enough-funds?that consumes an account and the amount that the customer wants to withdraw from the account and produces a boolean indicating whether the account has enough funds to cover the withdrawal plus fees (if applicable). Savings account holders pay a $1 fee if they have done more than 4 withdrawals during the month. No fees apply to checking accounts. - Write a function
start-monththat consumes an account and produces an account. If the original account is a checking account, the new account balance is 1.5% higher. If the original account is a savings account, the new account balance is 3% higher and the number of withdrawals made is zero.




