Also turn in a log of how many errors of different kinds you encountered in the assignment, with brief comments describing each one ("mismatched parentheses" is self-explanatory, but more complex errors might need more description).
This assignment is to be done in pairs, as before.
Do (but don't turn in) exercises 7.1.1, 7.1.2, 7.1.3, and 7.3.1, (the last two of which are very similar to an exercise we did in class). Although you don't need to turn these in, make sure you know how to do them before going on to the next exercises.
A bank has three kinds of accounts: checking, savings, and credit. A checking account has a balance and a number of transactions. A savings account has a balance, interest rate, and number of transactions. A credit account has a balance, credit limit, and number of transactions.
Write data and structure definitions, and function templates, for all three of these, as well as a data definition for "account" (which includes all three).
The bank thinks of withdrawing money as an operation that takes an
account and an amount, and returns an account of the same kind as
the original, but with a changed balance and one more transaction.
For example,
(withdraw (make-checking 800 5) 200)
"should be (make-checking 600 6)"
Develop this withdraw function. Note that
since a credit account's balance indicates how much you owe,
withdrawing money from a credit account increases the balance
rather than decreasing it.
Next, develop a checked-withdraw function, which is like withdraw except that if someone tries to withdraw too much, it prints an error message and doesn't return anything at all. For a savings account, you can't withdraw more than the balance. All checking accounts have $1000 overdraft protection, so you can withdraw up to $1000 more than the balance, but no more than that. For credit accounts, you can't withdraw so much that the new balance is more than the credit limit.
Do all the exercises in
section 7.4.
(Turn the 7.4 exercises in together, all in one Definitions window. Feel
free to copy-and-paste functions you've written for previous
assignments, if they make it easier. Since the functions in section 7.4
do nothing but draw on the screen, don't worry about the usual
"turn in test output" rule.)