My code keeps showing me an error and saying that my "redo" in the end part of my do while loop the symbol is not found.
I want to be able to ask if the user would like to repeat this random number guessing and if they say "y" or "Y" then it produces anoter random number & repeats the program!
Help please what is wrong..???
package mylab; import javax.swing.JOptionPane; public class MyLab { public static void main(String[] args) { do { int random; int guess; String redo; random = (int)((Math.random()* 9 + 1)); System.out.println("The random number is: " + random); // Prompt user to enter a guess for the number JOptionPane.showMessageDialog(null, "I have a secret number, can you guess what it is?"); do { String stringOne = JOptionPane.showInputDialog("Guess the number: "); guess = Integer.parseInt(stringOne); if (guess < random) JOptionPane.showMessageDialog(null, "To small, try again!!!!"); else if (guess > random) JOptionPane.showMessageDialog(null, "Too large, try again!!!"); else if (guess == random) redo = JOptionPane.showInputDialog(null, "Bingo! Another try? (Y/N)"); } while (guess != random); } while (redo == "Y" || redo == "y"); } }