IronMan wrote: » Ah, the old ATM Java excercise, the memories of college assignments come flooding back. Next is the elevator simulation program, and the vending machine excercise.
FruitLover wrote: » Have you considered switching to a course more suited to your interests and abilities? Judging from your previous posts here, I don't think computer programming is really your kind of area....
tags as, and im giving you the benefit of the doubt here, your code is completely syntactically wrong... you missing keywords, like "switch" and looks like you are confusing while and do/while too. [code] switch(input) { case 1: // ... break; case 2: // ... break; default: //... }
do { choiceAsString = JOptionPane.showInputDialog(menuText); if(choiceAsString.equals("D")) { depositAsString = JOptionPane.showInputDialog("Please " + "enter the amount you wish to deposit"); try { deposit = Float.parseFloat(depositAsString); } catch (Exception e) { deposit = 0f; e.printStackTrace(); // might want to look up exceptions ;) } balance += deposit; JOptionPane.showMessageDialog(null,"Your Balance is now " + String.format("£%.2f",balance) + "ATM Balance",JOptionPane.PLAIN_MESSAGE); } else if (choiceAsString.equals("W")) { // ... } else { // invalid choice } } while (!choiceAsString.equals("X"));
Ri_Nollaig wrote: » what kind of thing is that to say!