1. It loops after I ask it to withdraw
Doesn't look like you ever return to the main menu. It will probably do the same thing if you do a deposit.
2. doesnt carry newBalance
throughout the program
Where are you transferring the method results to the balance?
double x=0;
double balance=Double.parseDouble(orignalBalance);
mainMenu=mainMenuOption();
while(!(mainMenu==4))
{ if (mainMenu==1)
{
x=withdrawl(balance);
System.out.println("Balance= $"+x);
}
else if (mainMenu==2)
{
x=deposit(balance);
System.out.println("Balance= $"+x);
}
}
3.I need an extra feature other than withdraw, deposit and display balance
1. I see no routines for menu options 3 or 4.
2. What other functions can an ATM do? I am not going to do all of your homework.
Other notes: Have you tried "validation" routine with more than the first account? All three of your
if
statements are looking at
String a
, and none at the other accounts (b,c).
It's pretty obvious that you are writing this based on the solution I gave in your other post. A thank-you, comment, or upvote would be nice.
I have to create a mini ATM code, and I can't figure out where to start?[
^]