Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: fast food java problem

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default fast food java problem

    java.jpg

    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");
    System.out.print("Choose Menu: ");
    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");
    System.out.print("Choose your order: ");
    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");
    System.out.print("Choose your order: ");
    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");
    System.out.print("Choose your order: ");
    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");
    System.out.print("Choose your order: ");
    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");
    System.out.print("Choose your order: ");
    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");
    System.out.print("Choose your order: ");
    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("Your total bill is php");
    System.out.print(" Thanks for choosing Starbucks"+"\n");
    System.out.print("Have a nice Day");
    }

    }
    }
    }


  2. #2
    Junior Member
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: fast food java problem

    please help me with this one

  3. #3
    Member Zyrion's Avatar
    Join Date
    Feb 2013
    Location
    Iowa
    Posts
    106
    My Mood
    Angelic
    Thanks
    2
    Thanked 8 Times in 8 Posts

    Default Re: fast food java problem

    Please put your code in tags.

    [code=java]
    <Code here>
    [/C0DE]

Similar Threads

  1. Need Help Fast - Please Help in Java ArrayList
    By anonb in forum Collections and Generics
    Replies: 6
    Last Post: November 5th, 2012, 04:26 PM
  2. Help with Fast Matrix Exponentiation
    By asundar in forum What's Wrong With My Code?
    Replies: 2
    Last Post: September 18th, 2012, 02:41 PM
  3. need HELP FAST PLEASE HELP ME
    By britben95 in forum Member Introductions
    Replies: 1
    Last Post: November 14th, 2011, 07:05 PM
  4. need help fast
    By coke32 in forum Loops & Control Statements
    Replies: 6
    Last Post: October 31st, 2011, 11:04 PM
  5. need help fast!!
    By nwollis in forum What's Wrong With My Code?
    Replies: 3
    Last Post: September 27th, 2010, 05:12 PM