Print menu only once
This commit is contained in:
parent
7dfedb2f16
commit
af7220b0d5
@ -23,7 +23,6 @@ public class ShoppingCartManager {
|
|||||||
char userInput;
|
char userInput;
|
||||||
userInput = 0;
|
userInput = 0;
|
||||||
|
|
||||||
while (userInput != 'q'){
|
|
||||||
System.out.println("MENU\n"+
|
System.out.println("MENU\n"+
|
||||||
"a - Add item to cart\n"+
|
"a - Add item to cart\n"+
|
||||||
"d - Remove item from cart\n"+
|
"d - Remove item from cart\n"+
|
||||||
@ -31,6 +30,7 @@ public class ShoppingCartManager {
|
|||||||
"i - Output items' descriptions\n"+
|
"i - Output items' descriptions\n"+
|
||||||
"o - Output shopping cart\n"+
|
"o - Output shopping cart\n"+
|
||||||
"q - Quit");
|
"q - Quit");
|
||||||
|
while (userInput != 'q'){
|
||||||
userInput = scnr.next().charAt(0);
|
userInput = scnr.next().charAt(0);
|
||||||
scnr.nextLine();
|
scnr.nextLine();
|
||||||
switch (userInput) {
|
switch (userInput) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user