Problem Statement:
Write a Java program that simulates a simple banking teller machine. The machine contains a list of account holders and their balance. There are two types of accounts- checking and credit card. Both accounts contain a unique account number, a name, a type (“checking” or “credit card”) and a balance. In a checking account, the balance is the amount of money available for withdrawal. In a credit card, the balance is the total amount withdrawn. The credit card account also contains a credit limit which is the maximum amount the account holder can withdraw.
Upon starting the program, the list of accounts will be read from a text file named accounts.txt. A text file containing information on 5 accounts is provided with this assignment.
The program will provide an ongoing loop that prompts for account number and amount of cash to receive. The account number must match an existing account- if the number is invalid, the user will be notified and the transaction ended.
If the account is a checking account, the amount of cash requested will be checked to make sure there is enough in the balance to cover the cash withdrawal. If there is, the cash amount will be deducted from the account balance and the new balance printed to the user.
If the account is a credit card account, the amount of cash requested will be added to the balance if that addition will not cause the balance to exceed the credit limit. If it does exceed, the transaction will be canceled and the balance left unchanged. If not, the amount withdrawn will be added to the balance and the new balance printed to the user.
An example of user interface: (user inputs are in italics)
Please enter an account number: 1234
I’m sorry I cannot find that account - please try again.
Please enter an account number: 2222
Please enter amount of desired cash: 100
This is a checking account, pick up cash in cash slot. Your new balance is $300.
Do you want another transaction (Yes/No)? Y
Please enter an account number: 2223
Please enter amount of desired cash: 100
This is a credit card account, pick up cash in cash slot, your new balance is $600.
Do you want another transaction (Yes/No)? Y
Please enter an account number: 2223
Please enter amount of desired cash: 100
I’m sorry this will exceed your credit limit. Please try another account.
Do you want another transaction (Yes/No)? N
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of