At line 14 the program tries to convert the letter "S" to an int value.
Was the user supposed to enter a letter there ( just before line 14) or a number? If a letter, then the code should not...
Type: Posts; User: Norm
At line 14 the program tries to convert the letter "S" to an int value.
Was the user supposed to enter a letter there ( just before line 14) or a number? If a letter, then the code should not...
The Integer class has a method for converting a String to an int.
Use it after getting the String from the user with the JOPtionPane method.
Does it work now?
How is the code in post#7 different from the code in post#1?
I see the Scanner class which needs to be removed.
The values being returned by JOptionPane methods are not being assigned to variables...
Can you post the new code that uses what the JOptionPane methods return and does not use Scanner methods?
Try debugging the code by adding some println() statements to show the value of...
Have you read the API doc for the JOptionPane class and its methods?
Many methods return what the user has entered.
Mixing dialog windows and console input must be very confusing for the user. It would be better to use one or the other.
Try adding lots of println() statements to the code to show its...