logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

Write a Java program that simulates a simple banking teller machine.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

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

 

 

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

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. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

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

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

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

. 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 Sea Ports. Here are the classes and their instance variables we wish to define:

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

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Atharva PatilComputer science

675 Answers

Hire Me
expert
Chrisantus MakokhaComputer science

658 Answers

Hire Me
expert
AyooluwaEducation

521 Answers

Hire Me
expert
RIZWANAMathematics

591 Answers

Hire Me

Get Free Quote!

297 Experts Online