Question
import java.util.Scanner; import java.lang.*; public class Balance { public static void main(String ar[]) { char choice; //variable for choice Scanner input = new Scanner(System.in); //scanner
import java.util.Scanner; import java.lang.*;
public class Balance {
public static void main(String ar[]) { char choice; //variable for choice Scanner input = new Scanner(System.in); //scanner for input boolean loop = true; //boolean value for continue loop while (loop) { System.out.println("How much your balance?"); double balance = input.nextDouble(); System.out.println("-- MENU --"); //Prints the menu for deposite,withdraw, balance and exit System.out.println( " 1) Deposit " + " 2) Withdraw " + " 3) Balance " + " 4) Exit " ); System.out.print("Enter Choice:"); //askin for user input choice choice = input.next().charAt(0); switch (choice) { //user input choice in switch case case '1': //case 1 for deposite System.out.println("Enter amount to deposite"); //ask user to input the amount to deposite double a = input.nextDouble(); //store input value to a balance += a; break; case '2': System.out.println("Enter the amount to withdraw: "); //ask user to input the amount to withdraw double w = input.nextDouble(); //store input value to w if(w<0) //checks withdraw amount is greater than 0 { System.out.println("Please input valid amount greater than 0"); } else if(w Modify the Bank Teller program to do the following: Read the checking balance and saving balance from a file called balance.txt Provide a menu with the following options: Show checking balance Show saving balance Deposit to checking Deposit to saving Withdraw from checking Withdraw from saving Transfer from checking to saving Transfer from saving to checking Exit Provide method for each option When exit, save the current checking balance and saving balance to balance.txt file
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