Hello,
My goal is to produce a menu of a series of options. Options 1 & 2 will perform a function, and then loop back to the menu, 3 will exit the menu, and 4 will print "wrong option" for selections other than 1-3. I can't seem to get the options to look back to the menu once they are completed.
Here is an "essentials only" version, as the original is pretty long, but it can be provided if necessary.
public static void main(String[] args) {
// TODO code application logic here
int option;
Scanner input;
input = new Scanner(System.in);
System.out.println("enter an option");
option = input.nextInt();
if (option != 3)
{
if (option == 1)
{
System.out.println("option 1");
}else if (option == 2)
{
System.out.println("option 2");
;
}else if (option != 1 && (option != 2))
{
System.out.println("wrong option");
}
}
if (option == 3)
{
System.out.println("done");
}
option = input.nextInt();
}