I am attempting to create a (very) simple menu/sub-menu navigation system that resembles a (very) basic online shopping application.
The problem I am getting is that once I have entered the sub-menu (by entering 2 in the top-level menu), I am not able to leave the sub-menu; even when entering 3 or 4. I'm not sure why this is happening and any help would be appreciated.
while (subChoice != 3 || subChoice != 4) {
subMenu();
subChoice = getChoice(1, 4);
if (subChoice == 1) {
// Add items
System.out.println("add");
} else if (subChoice == 2) {
// Remove items
System.out.println("delete");
} else if (subChoice == 3) {
// Check out
System.out.println("check out");
} else if (subChoice == 4) {
// Discard cart
System.out.println("discard");
}
}