Account class Account.java
and write a main method in a different class to briefly experiment
with some instances of the Account class.
Account class as a base class, write two derived
classes called SavingsAccount and CurrentAccount.
A SavingsAccount object, in addition to the attributes of
an Account object, should have an interest variable and a
method which adds interest to the account. A CurrentAccount
object, in addition to the attributes of an Account object,
should have an overdraft limit variable. Ensure that you have overridden
methods of the Account class as necessary in both derived
classes.
Bank class, an object of which contains an
array of Account objects. Accounts in the array could be
instances of the Account class, the SavingsAccount
class, or the CurrentAccount class. Create some test accounts
(some of each type).
Bank class requires methods for opening and closing
accounts, and for paying a dividend into each account.
Hints:
deposit(double) and withdraw(double) methods.
Account class should not need to be modified at all.
Employee whose objects are records for
an employee. This class will be a derived class of the class Person
which you will have to copy into a file of your own and compile. An employee
record has an employee's name (inherited from the class Person),
an annual salary represented as a single value of type double,
a year the employee started work as a single value of type int
and a national insurance number, which is a value of type String.equals method. Write another class containing a
main method to fully test your class definition.
© 2001 Mark Ryan and Alan Sexton