Hi All,
Im attempting to make a simple java menu system. the psueo code is as follows
1. user is presented with menu
2. selection is made
3. that action is ran, i.e make a new user (i have this code seperate, which works)
4. the user is returned to the main menu.
what is actually happening is it keeps ending. I tried using a do while, but i cant seem to get my head around it.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package week7;
//import java.io.*;
//import java.io.IOException;
import java.util.Scanner;
/**
*
* @author Administrator
*/
public class whileDoTest {
@SuppressWarnings("empty-statement")
public static void main (String[]arguments)
{
int menuSelect = 0;
if (menuSelect ==0){
System.out.println("Please make your selection");
System.out.println("");
System.out.println("(1) - New book : (2) - New user : (3) - New Load");
Scanner scan = new Scanner(System.in);
menuSelect = scan.nextInt();
}else{
switch (menuSelect)
{
case 1:
if(menuSelect == 1) {
System.out.println("Selection 1");
System.out.println("(1) - Main Menu");
break;
}menuSelect = 0;
case 2:
if(menuSelect ==2) {
System.out.println("Selection 2");
break;
}
case 3:
if (menuSelect ==3){
System.out.println("Selection 3");
break;
}
}
}
}
}