首页 > > 详细

辅导Java编程、辅导BigWork、Java编程调试、调试JavaScanner

import java.util.Scanner;
public class BigWork{
public static void main(String args[]){
int []Staple={15,17,9,10,0,0};
int []Garnish={11,9,12,10,0,0};
int []Drinks={9,9,11,10,0,0};
int []Dessert={11,6,7,4,0,0};
int Price1=0,Price2=0,Price3=0,Price4=0;
int i1=0,i2=0,i3=0,i4=0;
int t1=0,t2=0,t3=0,t4=0;
String []StapleM={"double chesseburger","Big Mac","Barley chicken","Chicken Chop"};
String []GarnishM={"Large Fries","Spicy chicken wings","Fried chicken
drumsticks","Chicken wings"};
String []DrinksM={"Coca Cola","Pure milk","Black tea","Hot chocolate"};
String []DessertM={"Oreo wheat whirlwind","Pineapple pie","Red bean pie","ice-cream
cone"};
String []CartStaple=new String[100];
String []CartGarnish=new String[100];
String []CartDrinks=new String[100];
String []CartDessert=new String[100];
int []numbersStaple=new int[100];
int []numbersGarnish=new int[100];
int []numbersDrinks=new int[100];
int []numbersDessert=new int[100];

double TotalPrice=0;
int index1=0;
int index2=0;
int index3=0;


do{
System.out.println("********Main Menu********");
System.out.println("1. Staple Food\n2. Garnish\n3. Drinks\n4. Dessert\n5.
Check out\n6. Exit");
System.out.print("\nYour choice please:");
try{ Scanner sc=new Scanner(System.in);
index1=sc.nextInt();}
catch(Exception ioe)
{
System.out.println("Please input integer number from 1-6.");
continue;
}

if (index1==1)
do{

System.out.println("\n********Staple food Menu********");
System.out.println("1.double cheeseburger ¥ 15\n2.Big Mac ¥ 17\n3.Barley
chicken ¥ 9\n4.Chicken Chop ¥ 10\n5.Return to Main Menu");
System.out.print("\nYour choice please:");
try{ Scanner sc1=new Scanner(System.in);
index2=sc1.nextInt();}
catch(Exception ioe)
{

System.out.println("Please Enetr integer Number from 1-5");continue;

}
if(index2>5||index2=1index20)
{break;}
System.out.println("\nPlease input integer number more than 0!\n");
}while(index35||index2=1index20)
{break;}
System.out.println("\nPlease input integer number more than 0!\n");
}while(index35||index2=1index20)
{break;}
System.out.println("\nPlease input integer number more than 0!\n");
}while(index35||index2=1index20)
{break;}
System.out.println("\nPlease input integer number more than 0!\n");
}while(index36||index1<1)
{
System.out.println("\nPlease input integer number from 1-6.\n");continue;

}
}while(true);
}
}
 

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!