my program is almost done! just one more problem
i want to display in the O.I part the items that the user orders i wonder how am i gonna do that?
here is my syntax
System.out.println ("\n *************************************"); System.out.print (" ||Enter choice: "); choice1 = input.nextInt (); System.out.println (" *************************************"); if (choice1 == 1) { do { System.out.println ("\n **---------------------------------**"); System.out.println (" **---------------------------------**"); System.out.println (" CHOOSE "); System.out.println (" 1 FOR BEVERAGES "); System.out.println (" 2 FOR MEALS "); System.out.println (" 3 FOR DESSERTS "); System.out.println (" **---------------------------------**"); System.out.println (" **---------------------------------**"); System.out.println ("\n *************************************"); System.out.print (" ||Enter choice: "); choice2 = input.nextInt (); System.out.println (" *************************************"); if (choice2 == 1) { do { System.out.println ("\n **---------------------------------**"); System.out.println (" *---------------------------------* "); System.out.println (" || BEVERAGES ||"); System.out.println (" *---------------------------------* "); System.out.println (" *| 1 FOR MC CAFE |*"); System.out.println (" || 2 FOR MC CAFE (LARGE) ||"); System.out.println (" || 3 FOR MC FlOAT ||"); System.out.println (" *| 4 FOR MONSTER FLOAT |*"); System.out.println (" *---------------------------------* "); System.out.println (" **---------------------------------**"); System.out.println ("\n *************************************"); System.out.print (" ||Enter choice: "); choice3 = input.nextInt (); System.out.println (" *************************************"); if (choice3 == 1) { System.out.print (" ||ENTER QUANTITY: "); bevQuant1 = input.nextInt (); } else if (choice3 == 2) { System.out.print (" ||ENTER QUANTITY: "); bevQuant2 = input.nextInt (); } else if (choice3 == 3) { System.out.print (" ||ENTER QUANTITY: "); bevQuant3 = input.nextInt (); } else if (choice3 == 4) { System.out.print (" ||ENTER QUANTITY: "); bevQuant4 = input.nextInt (); } bevTotal = bevQuant1*25.00 + bevQuant2*35.00 + bevQuant3*25.00 + bevQuant4*35.00; System.out.println (" *************************************"); System.out.println (" ||ADD ANOTHER DRINK(S)?"); System.out.println (" ||1 FOR YES 2 FOR NO"); System.out.print (" ||Enter choice: "); choice4 = input.nextInt (); System.out.println (" *************************************"); } while (choice4 == 1); } else if (choice2 == 2) { do { System.out.println ("\n **---------------------------------**"); System.out.println (" *---------------------------------* "); System.out.println (" || MEALS ||"); System.out.println (" *---------------------------------* "); System.out.println (" *| |*"); System.out.println (" || 1 FOR BIG MC ||"); System.out.println (" || 2 FOR BIG N' TASTY ||"); System.out.println (" || 3 FOR QUARTER POUND W/CHEESE ||"); System.out.println (" || 4 FOR MC DOUBLE ||"); System.out.println (" *| 5 FOR Mc SPICY |*"); System.out.println (" || 6 FOR MC NUGGETS ||"); System.out.println (" || 7 FOR FILET-O-FISH ||"); System.out.println (" || 8 FOR MC CHICKEN SANDWICH ||"); System.out.println (" || 9 FOR CHICKEN MCDO AND FRIES ||"); System.out.println (" *---------------------------------* "); System.out.println (" **---------------------------------**"); System.out.println ("\n *************************************"); System.out.print (" Enter choice: "); choice6 = input.nextInt (); System.out.println (" *************************************"); if (choice6 == 1) { do { mealCycle (); bigMcChoice = input.nextInt (); System.out.println (" **==========================================**"); if (bigMcChoice == 1) { System.out.print (" ||ENTER QUANTITY: "); bigMcQuant1 = input.nextInt (); } else if (bigMcChoice == 2) { System.out.print (" ||ENTER QUANTITY: "); bigMcQuant2 = input.nextInt (); } bigMcTotal = bigMcQuant1 * 175.00 + bigMcQuant2 * 155.00; orderRepeater (); bigMcChoice2 = input.nextInt (); System.out.println (" **==========================================**"); }while (bigMcChoice2 == 1); } else if (choice6 == 2) { do { mealCycle (); bigNTastyChoice = input.nextInt (); System.out.println (" **==========================================**"); if (bigNTastyChoice == 1) { System.out.print (" ||ENTER QUANTITY: "); bigNTastyQuant = input.nextInt (); } else if (bigNTastyChoice == 2 ) { System.out.print (" ||ENTER QUANTITY: "); bigNTastyQuant2 = input.nextInt (); } bigNTastyTotal = bigNTastyQuant * 172.00 + bigNTastyQuant2 * 152.00; orderRepeater (); bigNTastyChoice2 = input.nextInt (); System.out.println (" **==========================================**"); } while (bigNTastyChoice2 == 1); } else if (choice6 == 3) { do { mealCycle (); qPoundChoice = input.nextInt (); System.out.println (" **==========================================**"); if (qPoundChoice == 1 ) { System.out.print (" ||ENTER QUANTITY: "); qPoundQuant = input.nextInt (); } else if (qPoundChoice == 2 ) { System.out.print (" ||ENTER QUANTITY: "); qPoundQuant2 = input.nextInt (); } qPoundTotal = qPoundQuant * 169.00 + qPoundQuant2 * 149.00; orderRepeater (); qPoundChoice2 = input.nextInt (); System.out.println (" **==========================================**"); } while (qPoundChoice2 == 1); } else if (choice6 == 4) { do { System.out.println (" ||1 FOR REGULAR 2 FOR DELUXE"); System.out.print (" ||ENTER QUANTITY: "); mcDoubleRegOrDeluxe = input.nextInt (); if (mcDoubleRegOrDeluxe == 1) { do { mealCycle (); mcDoubleChoice = input.nextInt (); System.out.println (" **==========================================**"); if (mcDoubleChoice == 1 ) { System.out.print (" ||ENTER QUANTITY: "); mcDoubleQuant = input.nextInt (); } else if (mcDoubleChoice == 2 ) { System.out.print (" ||ENTER QUANTITY: "); mcDoubleQuant2 = input.nextInt (); } orderRepeater (); mcDoubleChoice2 = input.nextInt (); System.out.println (" **==========================================**"); } while (mcDoubleChoice2 == 1); } else if (mcDoubleRegOrDeluxe == 2) { do { mealCycle (); mcDoubleChoice3 = input.nextInt (); System.out.println (" **==========================================**"); if (mcDoubleChoice3 == 1 ) { System.out.print (" ||ENTER QUANTITY: "); mcDoubleQuant3 = input.nextInt (); } else if (mcDoubleChoice3 == 2 ) { System.out.print (" ||ENTER QUANTITY: "); mcDoubleQuant4 = input.nextInt (); } mcDoubleTotal = mcDoubleQuant * 130.00 + mcDoubleQuant2 * 110.00 + mcDoubleQuant3 * 155.00 + mcDoubleQuant4 * 135.00; orderRepeater (); mcDoubleChoice4 = input.nextInt (); System.out.println (" **==========================================**"); } while (mcDoubleChoice4 == 1); } System.out.println (" ||RETURN TO TYPE SELECTION? "); System.out.println (" ||1 FOR YES 2 FOR NO"); System.out.print (" ||Enter choice: "); mcDoubleRegOrDeluxe2 = input.nextInt (); }while (mcDoubleRegOrDeluxe2 == 1); } else if (choice6 == 5) { do { System.out.println ("\n **==========================================**"); System.out.println (" 1 W/MEDIUM FRIES & MEDIUM SOFTDRINK"); System.out.println (" 2 w/REGULAR FRIES & REGULAR SOFTDRINK"); System.out.println (" 3 w/SHAKE SHAKE FRIES & REGULAR SOFTDRINK"); System.out.println (" **==========================================**"); System.out.println ("\n **==========================================**"); System.out.print (" ||Enter choice: "); mcSpicyChoice = input.nextInt (); if (mcSpicyChoice == 1 ) { System.out.print (" ||ENTER QUANTITY: "); mcSpicyQuant = input.nextInt (); } else if (mcSpicyChoice == 2 ) { System.out.print (" ||ENTER QUANTITY: "); mcSpicyQuant2 = input.nextInt (); } else if (mcSpicyChoice == 3) { System.out.print (" ||ENTER QUANTITY: "); mcSpicyQuant3 = input.nextInt (); } mcSpicyTotal = mcSpicyQuant * 151.00 + mcSpicyQuant2 * 141.00 + mcSpicyQuant3 * 121.00; orderRepeater (); mcSpicyChoice2 = input.nextInt (); System.out.println (" **==========================================**"); } while (mcSpicyChoice2 == 1); } else if (choice6 == 6) { do { System.out.println ("\n **==========================================**"); System.out.println (" 1 FOR 6PC MC NUGGETS w/MEDIUM FRIES"); System.out.println (" 2 FOR 6PC MC NUGGETS w/MEDIUM SOFTDRINK"); System.out.println (" 3 FOR 6PC MC NUGGETS w/REGULAR SOFTDRINK"); System.out.println (" 4 FOR 6PC MC NUGGETS w/REG. FRIES & SOFTDRINK"); System.out.println (" **==========================================**"); System.out.println ("\n **==========================================**"); System.out.print (" ||Enter choice: "); mcNuggetChoice = input.nextInt (); if (mcNuggetChoice == 1) { System.out.print (" ||ENTER QUANTITY: "); mcNuggetQuant = input.nextInt (); } else if (mcNuggetChoice == 2 ) { System.out.print (" ||ENTER QUANTITY: "); mcNuggetQuant2 = input.nextInt (); } else if (mcNuggetChoice == 3) { System.out.print (" ||ENTER QUANTITY: "); mcNuggetQuant3 = input.nextInt (); } else if (mcNuggetChoice == 4) { System.out.print (" ||ENTER QUANTITY: "); mcNuggetQuant4 = input.nextInt (); } mcNuggetTotal = mcNuggetQuant * 146.00 + mcNuggetQuant2 * 132.00 + mcNuggetQuant3 * 125.00 + mcNuggetQuant4 * 120.00; orderRepeater (); mcNuggetChoice2 = input.nextInt (); System.out.println (" **==========================================**"); } while (mcNuggetChoice2 == 1); } else if (choice6 == 7 ) { do { mealCycle (); filetOFishChoice = input.nextInt (); System.out.println (" **==========================================**"); if (filetOFishChoice == 1 ) { System.out.print (" ||ENTER QUANTITY: "); filetOFishQuant = input.nextInt (); } else if (filetOFishChoice == 2 ) { System.out.print (" ||ENTER QUANTITY: "); filetOFishQuant2 = input.nextInt (); } filetOFishTotal = filetOFishQuant * 143.00 + filetOFishQuant2 * 123.00; orderRepeater (); filetOFishChoice2 = input.nextInt (); System.out.println (" **==========================================**"); } while (filetOFishChoice2 == 1); } else if (choice6 == 8) { do { mealCycle (); mcChickenSandwichChoice = input.nextInt (); System.out.println (" **==========================================**"); if (mcChickenSandwichChoice == 1 ) { System.out.print (" ||ENTER QUANTITY: "); mcChickenSandwichQuant = input.nextInt (); } else if (mcChickenSandwichChoice == 2 ) { System.out.print (" ||ENTER QUANTITY: "); mcChickenSandwichQuant2 = input.nextInt (); } mcChickenSandwichTotal = mcChickenSandwichQuant * 143.00 + mcChickenSandwichQuant2 * 123.00; orderRepeater (); mcChickenSandwichChoice2 = input.nextInt (); System.out.println (" **==========================================**"); } while (mcChickenSandwichChoice2 == 1); } else if (choice6 == 9) { do { mealCycle (); chickenMcdoAndFriesChoice = input.nextInt (); System.out.println (" **==========================================**"); if (chickenMcdoAndFriesChoice == 1 ) { System.out.print (" ||ENTER QUANTITY: "); chickenMcdoAndFriesQuant = input.nextInt (); } else if (chickenMcdoAndFriesChoice == 2 ) { System.out.print (" ||ENTER QUANTITY: "); chickenMcdoAndFriesQuant2 = input.nextInt (); } chickenMcdoAndFriesTotal = chickenMcdoAndFriesQuant * 159.00 + chickenMcdoAndFriesQuant2 * 149.00; orderRepeater (); chickenMcdoAndFriesChoice2 = input.nextInt (); System.out.println (" **==========================================**"); } while (chickenMcdoAndFriesChoice2 == 1); } System.out.println ("\n ***********************************"); System.out.println (" ||ADD ANOTHER MEAL(S)?"); System.out.println (" ||1 FOR YES 2 FOR NO"); System.out.print (" ||Enter choice: "); choice7 = input.nextInt (); mealTotal = bigMcTotal + bigNTastyTotal + qPoundTotal + mcDoubleTotal + mcSpicyTotal + mcNuggetTotal + filetOFishTotal + mcChickenSandwichTotal + chickenMcdoAndFriesTotal; } while (choice7 == 1); } else if (choice2 == 3) { do { System.out.println ("\n **---------------------------------**"); System.out.println (" *---------------------------------* "); System.out.println (" || DESSERTS ||"); System.out.println (" *---------------------------------* "); System.out.println (" *| 1 FOR HOT FUDGE |*"); System.out.println (" || 2 FOR SUNDAE ||"); System.out.println (" *| 3 FOR MC FLURRY |*"); System.out.println (" *---------------------------------* "); System.out.println (" **---------------------------------**"); System.out.println ("\n *************************************"); System.out.print (" ||Enter choice: "); choice8 = input.nextInt (); System.out.println (" *************************************"); if (choice8 == 1) { do { System.out.println ("\n **==========================================**"); System.out.println (" 1 FOR CARAMEL"); System.out.println (" 2 FOR UPSIZED CARAMEL"); System.out.println (" 3 FOR CHOCOLATE"); System.out.println (" 4 FOR UPSIZED CHOCOLATE"); System.out.println (" 5 FOR STRAWBERRY"); System.out.println (" 6 FOR UPSIZED STRAWBERRY"); System.out.println (" **==========================================**"); System.out.println ("\n **==========================================**"); System.out.print (" ||Enter choice: "); hotFudgeFlavorChoice = input.nextInt (); if (hotFudgeFlavorChoice == 1) { System.out.print (" ||ENTER QUANTITY: "); hotFudgeQuant = input.nextInt (); } else if (hotFudgeFlavorChoice == 2 ) { System.out.print (" ||ENTER QUANTITY: "); hotFudgeQuant2 = input.nextInt (); } else if (hotFudgeFlavorChoice == 3) { System.out.print (" ||ENTER QUANTITY: "); hotFudgeQuant3 = input.nextInt (); } else if (hotFudgeFlavorChoice == 4) { System.out.print (" ||ENTER QUANTITY: "); hotFudgeQuant4 = input.nextInt (); } else if (hotFudgeFlavorChoice == 5) { System.out.print (" ||ENTER QUANTITY: "); hotFudgeQuant5 = input.nextInt (); } else if (hotFudgeFlavorChoice == 6) { System.out.print (" ||ENTER QUANTITY: "); hotFudgeQuant6 = input.nextInt (); } hotFudgeTotal = hotFudgeQuant * 25.00 + hotFudgeQuant2 * 25.00 + hotFudgeQuant3 *25.00 + hotFudgeQuant4 * 25.00 + hotFudgeQuant5 * 25.00 + hotFudgeQuant6 * 25.00; System.out.println (" ||ADD ANOTHER FLAVOR(S)?"); System.out.println (" ||1 FOR YES 2 FOR NO"); System.out.print (" ||Enter choice: "); hotFudgeChoice2 = input.nextInt (); System.out.println (" **==========================================**"); } while (hotFudgeChoice2 == 1); } else if (choice8 == 2) { do { System.out.println ("\n **==========================================**"); System.out.println (" 1 FOR CARAMEL"); System.out.println (" 2 FOR CHOCOLATE"); System.out.println (" 3 FOR STRAWBERRY"); System.out.println (" **==========================================**"); System.out.println ("\n **==========================================**"); System.out.print (" ||Enter choice: "); sundaeFlavorChoice = input.nextInt (); if (sundaeFlavorChoice == 1) { System.out.print (" ||ENTER QUANTITY: "); sundaeFlavorQuant = input.nextInt (); } else if (sundaeFlavorChoice == 2 ) { System.out.print (" ||ENTER QUANTITY: "); sundaeFlavorQuant2 = input.nextInt (); } else if (sundaeFlavorChoice == 3) { System.out.print (" ||ENTER QUANTITY: "); sundaeFlavorQuant3 = input.nextInt (); } sundaeFlavorTotal = (sundaeFlavorQuant + sundaeFlavorQuant2 + sundaeFlavorQuant3) * 25.00; System.out.println (" ||ADD ANOTHER FLAVOR(S)?"); System.out.println (" ||1 FOR YES 2 FOR NO"); System.out.print (" ||Enter choice: "); sundaeFlavorChoice2 = input.nextInt (); System.out.println (" **==========================================**"); } while (sundaeFlavorChoice2 == 1); } else if (choice8 == 3) { System.out.println ("\n **==========================================**"); System.out.println (" FLAVOR OF THE DAY IS COOKIES & CREAM"); System.out.println (" **==========================================**"); System.out.println ("\n **==========================================**"); System.out.print (" ||Enter QUANTITY: "); mcTwirlQuant = input.nextInt (); System.out.println (" **==========================================**"); } mcTwirlTotal = mcTwirlQuant * 30.00; System.out.println ("**********************"); System.out.print ("ADD ANOTHER DESSERT(S)?"); System.out.print ("\n1 FOR YES 2 FOR NO"); System.out.print ("\nEnter choice: "); choice9 = input.nextInt (); } while (choice9 == 1); } System.out.println (" ||RETURN TO FOOD TYPE SELECTION? "); System.out.println (" ||1 FOR YES 2 FOR NO"); System.out.print (" ||Enter choice: "); choice5 = input.nextInt (); System.out.println (" ***********************************"); dessertTotal = hotFudgeTotal + sundaeFlavorTotal + mcTwirlTotal; } while (choice5 == 1); totalTotal = bevTotal + mealTotal + dessertTotal; System.out.print (" ENTER AMOUNT TENDERED: "); amountTendered = input.nextDouble (); System.out.println ("\n \n *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~* "); System.out.println (" |**||** WC DONALDS **||**| "); System.out.println (" *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~* "); System.out.println ("\n OFFICIAL INVIOCE "); System.out.println ("\n **==========================================**"); System.out.println (" THE TOTAL AMOUNT YOU HAVE ORDERED IS: " + totalTotal); System.out.println (" AMOUNT TENDERED IS:" + amountTendered); System.out.println (" **==========================================**"); change = amountTendered - totalTotal; System.out.println (" CHANGE: " + change); } } public static void mealCycle () { System.out.println ("\n **==========================================**"); System.out.println (" 1 W/MEDIUM FRIES & MEDIUM SOFTDRINK"); System.out.println (" 2 w/REGULAR FRIES & REGULAR SOFTDRINK"); System.out.println (" **==========================================**"); System.out.println ("\n **==========================================**"); System.out.print (" ||Enter choice: "); } public static void orderRepeater () { System.out.println (" ||ORDER FOR THE OTHER SIZE? "); System.out.println (" ||1 FOR YES 2 FOR NO"); System.out.print (" ||Enter choice: "); } }
the code above is just short and an overview i removed the declarations part because of text limits.
and
as you can see in the official invoice the only thing that will be printed is the cash invoice and the total.
i want to see the items that the user orders and be printed in the Official Invoice part and same as the quantity just like the official I.O of the MCDONALDS! thanks! and more power!