import java.util.*; public class InputMenu { public static Boolean menu = true; private static ArrayList order_list = new ArrayList(); private static int temp_store, bill = 0; private static Scanner scan = new Scanner(System.in); public static void display_menu() { // **menu array lists** // aint vegans String[] for_cheese_love = { "1-kashar cheese", "2-cheddar", "3-parmesan", "4-mozzarella" }; String[] kings_choice = { "1-kashar cheese", "2-Turkish sucuk", "3-salami", "4-black olive", "5-tomato", "6-green pepper", "7-mushroom", "8-sausage", "9-paprika", "10-corn" }; String[] Turkish = { "1-Turkish sucuk", "2-onion", "3-tomato", "4-Turkish pastrami", "5-green pepper", "6-kashar cheese" }; String[] margherita = { "1-mozzarella", "2-tomato", "3-basil" }; String[] i_like_hawaii = { "1-pineapple", "2-mozzarella", "3-bacon", "4-ham" }; String[] chicky_micky = { "1-grilled chicken breasts", "2-basil", "3-mozzarella", "4-parmesan", "5-tomato", "6-onion", "7-rocket" }; String[] i_like_hotties = { "1-mozzarella", "2-beef", "3-green pepper", "4-jalapeno", "5-rocket" }; String[] somethings_fishy = { "1-tuna", "2-garlic", "3-onion", "4-basil", "5-black olive" }; // for vegans String[] veggie_meggie = { "1-green pepper", "2-onion", "3-tomato", "4-mushroom", "5-black olive" }; String[] classic_salad = { "1-tomato", "2-green pepper", "3-cucumber", "4-lettuce", "5-rocket", "6-parsley", "7-red cabbage" }; // sweet cravings String[] turkish_delight = { "1-sesame butter", "2-sugar" }; String[] choco_crisis = { "1-nutella", "2-kitkat pieces" }; // menu display System.out.println(" " + "Ain't Vegan Menus"); System.out.println(" Menu 1: 4 Cheese Love Menu \n" + " " + Arrays.toString(for_cheese_love)); System.out.println(" "); System.out.println(" Menu 2: King's Choice Menu \n" + " " + Arrays.toString(kings_choice)); System.out.println(" "); System.out.println(" Menu 3: Turkish Menu \n" + " " + Arrays.toString(Turkish)); System.out.println(" "); System.out.println(" Menu 4: Margherita Menu \n" + " " + Arrays.toString(margherita)); System.out.println(" "); System.out.println(" Menu 5: I Like Hawaii Menu \n" + " " + Arrays.toString(i_like_hawaii)); System.out.println(" "); System.out.println(" Menu 6: Chicky Micky Menu \n" + " " + Arrays.toString(chicky_micky)); System.out.println(" "); System.out.println(" Menu 7: I Like Hotties Menu \n" + " " + Arrays.toString(i_like_hotties)); System.out.println(" "); System.out.println(" Menu 8: Something's Fishy Menu \n" + " " + Arrays.toString(somethings_fishy)); System.out.println(" "); System.out.println("**********************************"); System.out.println(" "); System.out.println(" " + "For Vegans"); System.out.println(" Menu 9: Classic Salad Menu \n" + " " + Arrays.toString(classic_salad)); System.out.println(" "); System.out.println(" Menu 10: Veggie Meggie Menu \n" + " " + Arrays.toString(veggie_meggie)); System.out.println(" "); System.out.println("**********************************"); System.out.println(" "); System.out.println(" " + "For Sweet Cravings"); System.out.println(" Menu 11: Turkish Delight Menu \n" + " " + Arrays.toString(turkish_delight)); System.out.println(" "); System.out.println(" Menu 12: Choco Crisis Menu \n" + " " + Arrays.toString(choco_crisis)); System.out.println(" "); System.out.println("**********************************"); System.out.println(" "); System.out.println(" " + "Drinks"); System.out.println(" 13: Coca Cola\n 14: Pepsi\n 15: Sprite\n 16: Fanta\n 17: Ayran\n 18: Icetea"); System.out.println(" "); System.out.print("Please enter your order's number: "); } public static void question(String str) { System.out.println("\nDo you want to order anything else?" + "\nIf 'yes' enter 'y'" + "\nIf 'no' enter 'n'"); order_list.add(temp_store + " - " + str); switch (scan.next()) { case "n": System.out.println("We received your order."); for (String list : order_list) { System.out.println(list); } System.out.println("Your order costs: " + bill+ "$"); break; case "y": System.out.println("Please make your order."); new InputMenu(); break; default: System.err.println("Please choose one of given options."); break; } } public static void Menu() { display_menu(); temp_store = scan.nextInt(); switch (temp_store) { case 1: System.out.println("You have chose Menu 1, 4 Cheese Love."); bill = bill + 13; question("Cheese Love"); break; case 2: System.out.println("You have chose Menu 2, King's Choice."); bill = bill + 15; question("King's Choice"); break; case 3: System.out.println("You have chose Menu 3, Turkish."); bill = bill + 15; question("Turkish"); break; case 4: System.out.println("You have chose Menu 4, Margherita."); bill = bill + 12; question("Margherita"); break; case 5: System.out.println("You have chose Menu 5, I Like Hawaii."); bill = bill + 14; question("I Like Hawaii"); break; case 6: System.out.println("You have chose Menu 6, Chicky Micky."); bill = bill + 14; question("Chicky Micky"); break; case 7: System.out.println("You have chose Menu 7, I Like Hotties."); bill = bill + 14; question("I Like Hotties"); break; case 8: System.out.println("You have chose Menu 8, Something's Fishy."); bill = bill + 14; question("Something's Fishy"); break; case 9: System.out.println("You have chose Menu 9, Classic Salad."); bill = bill + 10; question("Classic Salad"); break; case 10: System.out.println("You have chose Menu 10, Veggie Meggie."); bill = bill + 13; question("Veggie Meggie"); break; case 11: System.out.println("You have chose Menu 11, Turkish Delight."); bill = bill + 13; question("Turkish Delight"); break; case 12: System.out.println("You have chose Menu 12, Choco Crisis."); bill = bill + 12; question("Choco Crisis"); break; case 13: System.out.println("You have chose 13, Coca Cola."); bill = bill + 4; question("Coca Cola"); break; case 14: System.out.println("You have chose 14, Pepsi."); bill = bill + 4; question("Pepsi"); break; case 15: System.out.println("You have chose 15, Sprite."); bill = bill + 4; question("Sprite"); break; case 16: System.out.println("You have chose 16, Fanta."); bill = bill + 4; question("Fanta"); break; case 17: System.out.println("You have chose 17, Ayran."); bill = bill + 3; question("Ayran"); break; case 18: System.out.println("You have chose 18, Icetea."); bill = bill + 3; question("Icetea"); break; default: System.err.println("Please choose one of given options."); break; } } public static void main(String[] args) { while (menu) { System.out.println(""); System.out.println(" WELCOME TO PIZZA TSCHI!"); System.out.println(" "); System.out.println("**********************************"); System.out.println(" "); Menu(); System.out.println("Do you want to exit system? 'y' for yes 'n' for no."); if (scan.next() == "y") { menu = false; } } } }