# fast food java problem

• March 13th, 2013, 09:51 PM
Anonymous08
fast food java problem
Attachment 1867

how can i compute the price from 1st order to 2nd order?

and display the total amount of payment?

this is my code..

import java.util.Scanner;
public class sample{
public static void main(String[]args){

int choose=0;
double size1, choose1;
int orderagain, qua;
Scanner input = new Scanner(System.in);
int x=1;
while(x==1)
{
System.out.print("|Espresso(1)|Refreshers(2)|Frapp uccino(3)|Tea(4)|Chocolatte(5)|Freshly Brewed Cofee(6)|" + "\n");
choose = input.nextInt();

if(choose==1)
{
System.out.print("(1)Espresso " + "\n");
System.out.print("(1)Solo 95 | (2)Doppio 105 " + "\n");
System.out.print("(2)Espresso Macchiato" + "\n");
System.out.print("(1)Solo 95 | (2)Doppio 105 " + "\n");
System.out.print("(3)Espresso con Panna" + "\n");
System.out.print("(1)Solo 95 | (2)Doppio 105 " + "\n");
System.out.print("(4)Caffè Americano" + "\n");
System.out.print("(3)Tall 105 | (4)Grande 120 | (5)Venti 130 " + "\n");
System.out.print("(5)Cappuccino" + "\n");
System.out.print("(6)Tall 110 | (7)Grande 125 | (8)Venti 135 " + "\n");
System.out.print("(6)Caffè Latte" + "\n");
System.out.print("(6)Tall 110 | (7)Grande 125 | (8)Venti 135 " + "\n");
System.out.print("(7)Caramel Macchiato" + "\n");
System.out.print("(9)Tall 140 | (10)Grande 155 | (11)Venti 165 " + "\n");
System.out.print("(8)Caffè Mocha" + "\n");
System.out.print("(7)Tall 125 | (9)Grande 140 | (12)Venti 150 " + "\n");
System.out.print("(9)White Chocolate Mocha" + "\n");
System.out.print("(9)Tall 140 | (10)Grande 155 | (11)Venti 165 " + "\n");
choose1= input.nextInt();
if (choose1==1)
System.out.print("Espresso" + "\n");
else if (choose1==2)
System.out.print("Espresso Macchiato" + "\n");
else if (choose1==3)
System.out.print("Espresso Con Panna" + "\n");
else if (choose1==4)
System.out.print("Caffè Americano" + "\n");
else if (choose1==5)
System.out.print("Cappuccino" + "\n");
else if (choose1==6)
System.out.print("Caffè Latte" + "\n");
else if (choose1==7)
System.out.print("Caramel Macchiato" + "\n");
else if (choose1==8)
System.out.print(")Caffè Mocha" + "\n");
else if (choose1==9)
System.out.print("White Chocolate Mocha" + "\n");
System.out.print("Choose the size: ");
size1= input.nextInt();
if (size1==1)
System.out.print("₱95.00" + "\n");
else if (size1==2)
System.out.print("₱105.00" + "\n");
else if (size1==3)
System.out.print("₱105.00" + "\n");
else if (size1==4)
System.out.print("₱120.00" + "\n");
else if (size1==5)
System.out.print("₱130.00" + "\n");
else if (size1==6)
System.out.print("₱110.00" + "\n");
else if (size1==7)
System.out.print("₱125.00" + "\n");
else if (size1==8)
System.out.print(")₱135.00" + "\n");
else if (size1==9)
System.out.print("₱140.00" + "\n");
else if (size1==10)
System.out.print("₱155.00" + "\n");
else if (size1==11)
System.out.print("₱165.00" + "\n");
else if (size1==12)
System.out.print("₱150.00" + "\n");
System.out.print("How Many: ");
qua= input.nextInt();
}
else if(choose==2)
{
System.out.print("(1)Cool Lime " + "\n");
System.out.print("(1)Tall 115 |(2) Grande 125 |(3) Venti 135 " + "\n");
System.out.print("(2)Very Berry Hibiscus" + "\n");
System.out.print("(1)Tall 115 |(2) Grande 125 |(3) Venti 135 " + "\n");
choose1= input.nextInt();
if (choose1==1)
System.out.print("Cool Lime" + "\n");
else if (choose1==2)
System.out.print("Very berry Hibiscus" + "\n");
System.out.print("Choose the size: ");
size1= input.nextInt();
if (size1==1)
System.out.print("₱115.00" + "\n");
else if (size1==2)
System.out.print("₱125.00" + "\n");
else if (size1==3)
System.out.print("₱135.00" + "\n");
System.out.print("How Many: ");
qua= input.nextInt();
}
else if(choose==3)
{
System.out.print("(1)Coffee " + "\n");
System.out.print("(1)Tall 130 |(2)Grande 140 |(3) Venti 150 " + "\n");
System.out.print("(2)Mocha" + "\n");
System.out.print("(4)Tall 135 | (5)Grande 145 |(6) Venti 155 " + "\n");
System.out.print("(3)Caramel" + "\n");
System.out.print("(4)Tall 135 | (5)Grande 145 |(6) Venti 155 " + "\n");
System.out.print("(4)Java Chip" + "\n");
System.out.print("(6)Tall 155 | (7)Grande 165 |(8) Venti 175 " + "\n");
System.out.print("(5)Coffee Jelly" + "\n");
System.out.print("(6)Tall 155 | (7)Grande 165 |(8) Venti 175 " + "\n");
System.out.print("(6)Dark Mocha" + "\n");
System.out.print("(7)Tall 165 | (8)Grande 175 | (9)Venti 185 " + "\n");
System.out.print("(7)Chocolate Chip Cream" + "\n");
System.out.print("(6)Tall 155 | (7)Grande 165 |(8) Venti 175 " + "\n");
System.out.print("(8)Strawberries & Cream" + "\n");
System.out.print("(6)Tall 155 | (7)Grande 165 |(8) Venti 175 " + "\n");
System.out.print("(9)Raspberry black Currant" + "\n");
System.out.print("(4)Tall 135 | (5)Grande 145 |(6) Venti 155 " + "\n");
System.out.print("(10)Mango Passion Fruit" + "\n");
System.out.print("(4)Tall 135 | (5)Grande 145 |(6) Venti 155 " + "\n");
choose1= input.nextInt();
if (choose1==1)
System.out.print("Coffee" + "\n");
else if (choose1==2)
System.out.print("Mocha" + "\n");
else if (choose1==3)
System.out.print("Caramel" + "\n");
else if (choose1==4)
System.out.print("Java Chip" + "\n");
else if (choose1==5)
System.out.print("Coffee Jelly" + "\n");
else if (choose1==6)
System.out.print("Dark Mocha" + "\n");
else if (choose1==7)
System.out.print("Chocolate Chip Cream" + "\n");
else if (choose1==8)
System.out.print("Strawberriess & Cream" + "\n");
else if (choose1==9)
System.out.print("Raspberry Black Currant" + "\n");
else if (choose1==10)
System.out.print("Mango Passion Fruit" + "\n");
System.out.print("Choose the size: ");
size1= input.nextInt();
if (size1==1)
System.out.print("₱130.00" + "\n");
else if (size1==2)
System.out.print("₱140.00" + "\n");
else if (size1==3)
System.out.print("₱150.00" + "\n");
else if (size1==4)
System.out.print("₱135.00" + "\n");
else if (size1==5)
System.out.print("₱145.00" + "\n");
else if (size1==6)
System.out.print("₱155.00" + "\n");
else if (size1==7)
System.out.print("₱165.00" + "\n");
else if (size1==8)
System.out.print("₱175.00" + "\n");
else if (size1==9)
System.out.print("₱185.00" + "\n");

System.out.print("How Many: ");
qua= input.nextInt();

}
else if(choose==4)
{
System.out.print("(1)Full-Leaf Brewed Tea" + "\n");
System.out.print("(1)Tall 95 | (1)Grande 95 |(2) Venti 110 " + "\n");
System.out.print("(2)Ful-Leaf Tea latte" + "\n");
System.out.print("(3)Tall 120 | (4)Grande 130 | (5)Venti 140 " + "\n");
System.out.print("(3)Green Tea Latte" + "\n");
System.out.print("(6)Tall 135 | (7)Grande 145 | (8)Venti 155 " + "\n");
System.out.print("(4)Chai Tea Latte" + "\n");
System.out.print("(6)Tall 135 | (7)Grande 145 | (8)Venti 155 " + "\n");
System.out.print("(5)Iced Tea" + "\n");
System.out.print("(1)Tall 95 | (9)Grande 105 | (10)Venti 115 " + "\n");
choose1= input.nextInt();
if (choose1==1)
System.out.print("Full-Leaf Brewed Tea" + "\n");
else if (choose1==2)
System.out.print("Ful-Leaf Tea latte" + "\n");
else if (choose1==3)
System.out.print("Green Tea Latte" + "\n");
else if (choose1==4)
System.out.print("Chai Tea Latte" + "\n");
else if (choose1==5)
System.out.print("Iced Tea" + "\n");
System.out.print("Choose the size: ");
size1= input.nextInt();
if (size1==1)
System.out.print("₱95.00" + "\n");
else if (size1==2)
System.out.print("₱110.00" + "\n");
else if (size1==3)
System.out.print("₱120.00" + "\n");
else if (size1==4)
System.out.print("₱130.00" + "\n");
else if (size1==5)
System.out.print("₱140.00" + "\n");
else if (size1==6)
System.out.print("₱135.00" + "\n");
else if (size1==7)
System.out.print("₱145.00" + "\n");
else if (size1==8)
System.out.print("₱155.00" + "\n");
else if (size1==9)
System.out.print("₱105.00" + "\n");
else if (size1==10)
System.out.print("₱115.00" + "\n");

System.out.print("How Many: ");
qua= input.nextInt();
}
else if(choose==5)
{
System.out.print("(1)Signature Hot Chocolate" + "\n");
System.out.print("(1)Tall 125 | (2)Grande 135 | (3)Venti 145 " + "\n");
System.out.print("(2)White Hot Chocolate" + "\n");
System.out.print("(4)Tall 120 | (5)Grande 130 | (6)Venti 140 " + "\n");
choose1= input.nextInt();
if (choose1==1)
System.out.print("Signature Hot Chocolate" + "\n");
else if (choose1==2)
System.out.print("White Hot Chocolate" + "\n");
System.out.print("Choose the size: ");
size1= input.nextInt();
if (size1==1)
System.out.print("₱125.00" + "\n");
else if (size1==2)
System.out.print("₱135.00" + "\n");
else if (size1==3)
System.out.print("₱145.00" + "\n");
else if (size1==4)
System.out.print("₱120.00" + "\n");
else if (size1==5)
System.out.print("₱130.00" + "\n");
else if (size1==6)
System.out.print("₱140.00" + "\n");
System.out.print("How Many: ");
qua= input.nextInt();
}
else if(choose==6)
{
System.out.print("(1)Brewed Coffee" + "\n");
System.out.print("(1)Tall 95 | (2)Grande 105 | (3)Venti 115 " + "\n");
System.out.print("(2)Caffè Misto" + "\n");
System.out.print("(1)Tall 95 | (2)Grande 105 | (3)Venti 115 " + "\n");
System.out.print("(3)Coffee Press" + "\n");
System.out.print("(4)12 oz.=110 | (5)16 oz.=120 | (6)32 oz.= 210 " + "\n");
choose1= input.nextInt();
if (choose1==1)
System.out.print("Brewed Coffee" + "\n");
else if (choose1==2)
System.out.print("Coffe Misto" + "\n");
else if (choose1==3)
System.out.print("Coffe Press" + "\n");
System.out.print("Choose the size: ");
size1= input.nextInt();
if (size1==1)
System.out.print("₱95" + "\n");
else if (size1==2)
System.out.print("₱105.00" + "\n");
else if (size1==3)
System.out.print("₱115.00" + "\n");
else if (size1==4)
System.out.print("₱110.00" + "\n");
else if (size1==5)
System.out.print("₱120.00" + "\n");
else if (size1==6)
System.out.print("₱210.00" + "\n");
System.out.print("How Many: ");
qua= input.nextInt();
}
System.out.print("Choose again Yes(1) No(2): ");
orderagain = input.nextInt();
if(orderagain == 1 )
{

}
else if(orderagain == 2)
{

x=2;
System.out.print(" Thanks for choosing Starbucks"+"\n");
System.out.print("Have a nice Day");
}

}
}
}
• March 13th, 2013, 10:31 PM
Anonymous08
Re: fast food java problem