Hi all,
I'm having a problem with my
java program. I am trying to make a program where the user enters a product number and a quantity, then at the end of the program the total of the order pops up. I have gotten as far as the last statement on my code without compilation errors, but when I try to display the total it either won't show up (if I move it up a bracket) or I get a compilation error. Can someone possibly help me with this? Thanks!
The error I get is this:
----jGRASP exec: javac -g C:\jGRASP Projects\JavaLoopsandSwitchStatements.java
JavaLoopsandSwitchStatements.java:65: <identifier> expected
JOptionPane.showMessageDialog(null, "The total is: " + orderAmount);
^
JavaLoopsandSwitchStatements.java:65: illegal start of type
JOptionPane.showMessageDialog(null, "The total is: " + orderAmount);
^
JavaLoopsandSwitchStatements.java:65: illegal start of type
JOptionPane.showMessageDialog(null, "The total is: " + orderAmount);
^
JavaLoopsandSwitchStatements.java:65: ')' expected
JOptionPane.showMessageDialog(null, "The total is: " + orderAmount);
^
JavaLoopsandSwitchStatements.java:65: ';' expected
JOptionPane.showMessageDialog(null, "The total is: " + orderAmount);
^
JavaLoopsandSwitchStatements.java:65: illegal start of type
JOptionPane.showMessageDialog(null, "The total is: " + orderAmount);
^
JavaLoopsandSwitchStatements.java:65: <identifier> expected
JOptionPane.showMessageDialog(null, "The total is: " + orderAmount);
^
JavaLoopsandSwitchStatements.java:65: ';' expected
JOptionPane.showMessageDialog(null, "The total is: " + orderAmount);
^
JavaLoopsandSwitchStatements.java:66: reached end of file while parsing
}
(I apologize if I didn't format the errors correctly.)
Thanks, Kat