As previous posters have indicated, the main bug in the posted program is that there is a semicolon at the end of each "if" line, meaning that the following code is not controlled by the "if", but instead is always executed. To fix, remove those semicolons.
However, beyond that, there is plenty to improve in the posted code.
Rather than have a huge set of "if" statements, you could use a HashMap to map menu items (
String) to cost (Integer).
Alternatively, as each menu item includes the price, you might be able to parse (read) the price within the menu item; look at the API for String.indexOf(), String.substring(), Integer.parseInt() etc. Or, if feeling brave, something similar but better can be achieved with a "regular expression"; see the
Pattern and Matcher classes.
[ June 16, 2008: Message edited by: Peter Chase ]