Skip to content

Instantly share code, notes, and snippets.

@annibuliful
Created August 29, 2018 01:03
Show Gist options
  • Select an option

  • Save annibuliful/e879dd7e7a95be4f7826cb63abbf7011 to your computer and use it in GitHub Desktop.

Select an option

Save annibuliful/e879dd7e7a95be4f7826cb63abbf7011 to your computer and use it in GitHub Desktop.
package restaurant;
import java.util.Scanner;
public class Restaurant {
public static void main(String[] args) {
// a array that use to store list of price of Rice
// String[] listOfRice =
int[] listOfPriceOfRice = {10 , 15 , 15 , 20};
int[] listOfPriceOfSideDish = {10 , 15 , 5 , 10 , 20};
int[] userSelection = {};
int sumOfPrice = 0;
System.out.print(">>>>>Wellcom to Sab Restaurant <<<<\n");
System.out.println("\n\t\t>> Sab restaurant <<");
System.out.println("\t*** menu *** \n");
System.out.println("\n 1. Steamed Rice.\t 10 Baht.");
System.out.println("\n 2. Fried Rice.\t\t 15 Baht.");
System.out.println("\n 3. Noodles.\t\t 15 Baht.");
System.out.println("\n 4. Udon.\t\t 20 Baht.");
System.out.println("\n 00. Exit Program.****");
Scanner scanner = new Scanner(System.in);
int inputNumber1 = scanner.nextInt();
userSelection[0] = inputNumber1 - 1;
sumOfPrice = sumOfPrice + listOfPriceOfRice[inputNumber1 - 1];
System.out.println("\n >> Meat and Veggie ");
System.out.println("\n 1. Chicken.\t 10 Baht.\t| 4. Tofu.\t 5 Baht.");
System.out.println("\n 2. Beef.\t 15 Baht.\t| 5. Fish.\t 10 Baht.");
System.out.println("\n 3. Egg.\t 5 Baht.\t| 6. Shrimp.\t 20 Baht.");
System.out.println("\n 7. Cashewnut.\t 5 Baht.\t|");
System.out.print("\n Meat and Veggie max is 3 choice **\nYou can Press 999 to continue. ***\n ");
int inputNumber2 = scanner.nextInt();
userSelection[1] = inputNumber2 - 1;
sumOfPrice = sumOfPrice + listOfPriceOfSideDish[inputNumber2 - 1];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment