Java Reference
In-Depth Information
8.19 Project
In this project, you are going to create simple bank software. You program will contain
the Test class, which contains the main method, and the Customer , BankAccount ,and
Employee classes, the abstract Person class, and the Transaction class. The Customer
and Employee classes will both inherit from the Person class.
The Person class will be abstract and will contain the name, address, and telephone num-
ber of the person. Each object of the Customer class will store, in addition, an ArrayList of
the bank accounts for that person. Each object of the Employee class will store, in addition,
the salary of the employee. Each object of the BankAccount class will have a variable cor-
responding to the account number (of type integer) and an ArrayList of the transactions
for that account. Each object of type Transaction will contain the date of the transaction
(of type Date ), the type of transaction (deposit or withdraw), the employee who performed
the transaction, the bank account on which the transaction was performed, and the dollar
amount of the transaction (to be stored in a double). Note that the current day and time
can be saved in a variable of type Date as follows: Date d = new Date() .Notethatall
instance variables should be declared private .
As you have probably guessed by now, you will need to create an ArrayList of People
in the Test class. Your main method should print a menu that allows the user to insert a
new employee or a customer, create a new account for a person, or withdraw/deposit money
from/to a bank account. Operations, such as changing the address and phone number of
a person or the salary of an employee should also be supported. Your program should not
allow negative balances for bank accounts and should print an appropriate message, for
example, “Insu cient funds to perform transaction” when a withdraw transaction tries to
withdraw too much money. For simplicity, you can assume that people and bank accounts
are never deleted. Use an automatically generated ID for people, transactions, and bank
accounts. The ID can be generated from a static variable that is initially set to 0.
Search WWH ::

Custom Search