Question: EST- ple 1) ay (Q2) Description The code provided reads in the users bank balance and stores it in the variable balance. It then

EST- ple 1) ay (Q2) Description The code provided reads in the

EST- ple 1) ay (Q2) Description The code provided reads in the users bank balance and stores it in the variable balance. It then reads in the amount the user would like to withdraw and stores it in a variable called withdraw. Your task is print various output situations depending on whether they have enough money to withdraw, have exactly the right amount to withdraw or not enough to withdraw. Refer to the below input/output examples for the exact prompts that need to be printed. Example I/O (the text in bold and italics is examples of user input): Enter your bank balance: 1000 Enter your withdrawal amount: 1110 You don't have enough money to withdraw. Enter your bank balance: 106 + Withdraw.java 1 import java.util.Scanner; 3 public class Withdraw { 1234567 public static void main(String[] args) { 8 9 10 11 12 13 14 } 15 } Scanner sc = new Scanner(System.in); System.out.print("Enter your bank balance: "); double balance = sc.nextDouble(); System.out.print("Enter your withdrawal amount: "); double withdraw = sc.nextDouble(); // DON'T TOUCH ANY CODE ABOVE THIS LINE // Your code goes here! I Enter your withdrawal amount: 100 You have withdrawn 100.0, your remaining | Enter your bank balance: 550.2 Enter your withdrawal amount: 550.2 You have withdrawn 550.2, your bank accou All chang /home/Withdraw.java Spaces: 4 (Auto) Run Console 17:0

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 Programming Questions!