Comp 2673
Spring 2002
Homework 4
Due Monday, April 22
- (15 pts) The class Maze that we created in lectures 7, 8 and 9 has a memory
leak (in one of the functions that has been implemented). Find it and
explain how to fix it.
- (20 pts) Write the declaration for three classes: BankAccount,
CheckingAccount, and SavingsAccount. All three clases should have
appropriate constructors. BankAccount should have an account number, an id
for the account holder, and an account balance. Provide member functions
for depositing, withdrawing, and finding out the balance and the account number.
The classes CheckingAccount and SavingsAccount should each be
derived from the BankAccount class. The CheckingAccount class should
inherit all of BankAccount's members, and should have additional data
members for minimum balance and service fee. Provide access functions
(get and set) for these data members, and a function for charging the
monthly fee to the account. The SavingsAccount class should also inherit
all of BankAccounts's members, and should have an additional data
member for the interest rate. Provide access functions (get and set) for
this data member, and a function for adding the accrued interest to the
account. Please note that I am not asking you to implement these classes -
just write the declarations.
- (15 pts) April 29 (the due date for your first project) is drawing near.
By April 22, you should have at the very least implemented
reading of the data files, and building the data structures.
Preferably you will also have implemented a couple of the functions
for generating the lists of relatives. Write down a few lines that
tell me what the status of your program is. If you are working with
another person, also tell me how you think the collaboration is going.