Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started