Skip to content

Commit

Permalink
Merge pull request #24 from sekwanaa/makeUesrInputMoreVersatile
Browse files Browse the repository at this point in the history
Made User inputs more versatile
  • Loading branch information
sekwanaa authored Jun 18, 2024
2 parents 1cd98aa + 24bb857 commit a893ca8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/main/java/com/pluralsight/DeliApp.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.pluralsight;

import com.pluralsight.util.Inputs;
import com.pluralsight.ui.HomeScreen;
import com.pluralsight.util.Inputs;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

Expand All @@ -14,7 +14,6 @@ public static void main(String[] args) {
Inputs.openScanner();

SpringApplication.run(DeliApp.class, args);

HomeScreen.displayHomeScreen();

Inputs.closeScanner();
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/com/pluralsight/ui/OrderScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ private boolean processOrderMenuChoice() {
String orderMenuChoice = Inputs.getString();

switch (orderMenuChoice) {
case "1" -> {
case "1", "one" -> {
CreateSandwichScreen createSandwichScreen = new CreateSandwichScreen(userOrder);
createSandwichScreen.sandwichCreationHomeScreen();
}
case "2" -> orderDrink();
case "3" -> addChips();
case "4" -> orderSides();
case "2", "two" -> orderDrink();
case "3", "three" -> addChips();
case "4", "four" -> orderSides();
case "E", "e" -> {
//Ask user what items they would like to edit
Text.clearConsole();
Expand Down Expand Up @@ -148,15 +148,15 @@ private boolean processDrinkMenuChoice() {
double price;

switch (userChoice) {
case "1" -> {
case "1", "one" -> {
size = "Small";
price = 2.00;
}
case "2" -> {
case "2", "two" -> {
size = "Medium";
price = 2.50;
}
case "3" -> {
case "3", "three" -> {
size = "Large";
price = 3.00;
}
Expand Down Expand Up @@ -238,16 +238,16 @@ private void processEditingMenuChoice() {
String userChoice = Inputs.getString();

switch (userChoice) {
case "1":
case "1", "one":
selectWhichItemToEdit(userOrder.getSandwiches());
break;
case "2":
case "2", "two":
selectWhichItemToEdit(userOrder.getDrinks());
break;
case "3":
case "3", "three":
selectWhichItemToEdit(userOrder.getChips());
break;
case "4":
case "4", "four":
selectWhichItemToEdit(userOrder.getSidesList());
break;
case "X", "x":
Expand Down

0 comments on commit a893ca8

Please sign in to comment.