Project 2 - Using and Creating
Multiple Classes
For this programming assignment, you will write two classes. First
write a class called BankAccount that represents a checking or savings
account at a bank. The class should have methods that allow:
- Account creation (constructors) with either a default 0 balance,
or a specified balance which is passed in to the constructor
- Withdrawals, given a specified withdrawal amount - if the
withdrawal amount is greater than the account balance, do not carry out
the transaction, and charge the account an overdraw fee of $25.
- Deposits, given a deposit amount
- Balance statement - return the current account balance
Your BankAccount class should store the account balance and an account
number. Account numbers should begin with one; the first account
created will have account number 1, the second account created will
have account number 2, etc.
The second class that you write will be called AccountTest, and you
will use it to test your BankAccount class. This class should create
some BankAccount instances, and you will be graded on how adequately
you test the functionality of the BankAccount class.
This program is due at 5 pm on Tuesday, September 14, 2004.