Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

Find the sum of each sequence. 60 (24) k=10

Answered: 1 week ago