General discussion
Thread display: Collapse - |
All Comments
Start or search
Create a new discussion
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
plz help me this is my final exam
public class Ordering1
{
public static InputStreamReader reader=new InputStreamReader(System.in);
public static BufferedReader input=new BufferedReader(reader);
public static void main(String[]args) throws IOException
{
String sausage="a1";
String crispy="a2";
String longganisa="a3";
String corn="a4";
String beef="a5";
String steak="a6";
String hotdog="a7";
String pancake="a8";
String order="";
String end="none";
String sure="yes";
int a1=0;
int a2=0;
int a3=0;
int a4=0;
int a5=0;
int a6=0;
int a7=0;
int a8=0;
int suma1=0;
int suma2=0;
int suma3=0;
int suma4=0;
int suma5=0;
int suma6=0;
int suma7=0;
int suma8=0;
int numa1=0;
int numa2=0;
int numa3=0;
int numa4=0;
int numa5=0;
int numa6=0;
int numa7=0;
int numa8=0;
int total=0;
System.out.println("\n\n \"WELCOME\"\n\n BREAKFAST & BRUNCH ENTREES\n\n ");
System.out.print(" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n");
System.out.print(" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
System.out.print(" ? code MENU ?\n");
System.out.print(" ? a1: Sausage and Egg Pandesal ?\n");
System.out.print(" ? a2: Crispy Bangus ?\n");
System.out.print(" ? a3: Longganisa ?\n");
System.out.print(" ? a4: Corned Beef ?\n");
System.out.print(" ? a5: Beef Tapa ?\n");
System.out.print(" ? a6: Breakfast Steak ?\n");
System.out.print(" ? a7: Hotdog ?\n");
System.out.print(" ? a8: Pancake ?\n");
System.out.print(" ? ?\n");
System.out.print(" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
System.out.print(" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n");
do
{
System.out.print("may i take your order? ");
order=input.readLine();
while(!order.equalsIgnoreCase(end))
{
while(order.equalsIgnoreCase(sausage))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a1++;
}
while(order.equalsIgnoreCase(crispy))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a2++;
}
while(order.equalsIgnoreCase(longganisa))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a3++;
}
while(order.equalsIgnoreCase(corn))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a4++;
}
while(order.equalsIgnoreCase(beef))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a5++;
}
while(order.equalsIgnoreCase(steak))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a6++;
}
while(order.equalsIgnoreCase(hotdog))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a7++;
}
while(order.equalsIgnoreCase(pancake))
{
System.out("\nAdd \n a1: Sausage and Egg Pandesal \n a2: Crispy Bangus \n a3: Longganisa \n a4: Corned Beef \n a5: Beef Tapa \n a6: Breakfast Steak \n a7: Hotdog \n a8: Pancake \"none\" : ");
order=input.readLine();
a8++;
}
suma1=suma1+a1;
suma2=suma2+a2;
suma3=suma3+a3;
suma3=suma3+a3;
suma3=suma3+a3;
suma3=suma3+a3;
suma3=suma3+a3;
suma3=suma3+a3;
System.out.print("You Order
}
numa1=10*suma1;
numa2=20*suma2;
numa3=30*suma3;
numa4=30*suma4;
numa5=30*suma5;
numa6=30*suma6;
numa7=30*suma7;
numa8=30*suma8;
total=numa1+numa2+numa3+numa4+numa5+numa6+numa7+numa8;
System.out.println("Total Amount : P"+total+".00\n");
System.out.print("Order Again? ");
order=input.readLine();
}
while(order.equalsIgnoreCase(sure));
System.out.print("Just w8 4 a while Maam/Sir..");
System.exit(0);
}
}
//this is my program... pls help me solve the errors