Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Auditing An International Approach

Authors: Wally J. Smieliauskas, Kathryn Bewley

6th edition

978-0070968295, 9781259087462, 978-0071051415

More Books

Students also viewed these Accounting questions

Question

Is there something else I need more?

Answered: 1 week ago