Question: A relatively simple simulation of an ATM machine and its basic functions. First, the user is prompted to insert his or her ATM card and

A relatively simple simulation of an ATM machine and its basic functions. First, the user is prompted to insert his or her ATM card and enter a password. Your ATM should have different responses (obviously!) for the correct vs. wrong password. (This you can implement, for example, by simply storing a 4-digit integer in a variable, then comparing the user’s input from cin with that integer value.)

Assuming the user has entered the correct PIN, the user then gets prompted for one of the several typical ATM actions:

Viewing acct. balance

Making a deposit

Making a withdrawal

For simplicity, feel free to assume the user has exactly one account. In case of deposit or withdrawal, the user should be informed what’s the new balance (increased by the deposit amount or decreased by the withdrawn amount). The user should be prompted, after each completed transaction, if (s)he would like to do another transaction? Eventually, once the user states (s)he is done / no more transactions desired, the ATM should thank the user, print out his/her final balance, and remind the user to take back his/her card.

Requires:

variables, data types, numerical operators, logical operations

basic input/output

while loops (if you want to prompt the user more than once)

logic (if statements, if/else if/else; you may consider using switch)

More complex implementations may also use methods

Step by Step Solution

3.50 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

CODE import javaio import javautil Bank class public class Bank static variable denoting account balance static long acntbalanace 0 this is the demo password you can change it if you need static int p... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!