A relatively simple simulation of an ATM machine and its basic functions. First, the user is prompted
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 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
Auditing An International Approach
ISBN: 978-0071051415
6th edition
Authors: Wally J. Smieliauskas, Kathryn Bewley