Question: JAVA Program The goal of this program is to create an ATM interface. Create a new class with a global variable of type double named

JAVA Program

The goal of this program is to create an ATM interface.

Create a new class with a global variable of type double named balance.

Implement four ATM menu options:

1.Deposit - Increases the balance accordingly

2.Withdraw - Decreases the balance accordingly.

3.Show balance - Prints the balance to the user

4.Exit - Ends the ATM program

The functionality of all of these options, except for Exit, should be contained within a method.

The ATM should first welcome the user and display the input options. In order to specify an option, use Scanner to allow the user to enter the numbers 1, 2, 3, or 4, corresponding to the options Deposit, Withdraw, Show balance, and Exit, respectively.

The ATM should continue to prompt the user for an option (in the main) until the user decides to Exit (4) the ATM. If the user chooses 1 or 2, the ATM should prompt the user to input an amount to deposit or withdraw. If the user attempts to withdraw more money than they have, do not withdraw the money and instead print an error message.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!