The owner of the ‘Lunch Café’ aims to sell daily a reasonably-priced three-course lunch to the local student community. To save costs, each day there is only a single choice of starter, main course and dessert. As with most establishments of its kind, the largest profit comes from selling the main courses. Unfortunately, the local students being frugal, hard-working and cost-conscious tend to only order a starter and/or a dessert.
As an incentive to order main courses, the owner has decided – where customers order a main course – to provide, free of charge:
• a soft drink if they also order a starter;
• coffee if they also order a dessert;
• both a soft drink and a coffee if all 3 courses are ordered.
If customers do not order a main course or if they only order a main course, then there are no drinks provided.
You are to write a program that advises staff what to provide. The program should ask what course(s) the customer is ordering and output what is to be provided. The choices are:
• starter at RM3
• main course at RM6
• dessert at RM4
• soft drink at RM1.5 (free only if both a starter & a main course have been ordered)
• coffee at RM2 (free only of both a dessert & a main course have been ordered)
Menu:
Do you want to order starter? (true/false): true
No of starter: 1
Do you want to order main course? (true/false): true
No of main course: 2
Do you want to order dessert? (true/false): true
No of dessert:1
You have ordered 1 starters, 2 main course, 1 dessert,1 soft drink, 1 coffee
Total: RM19
Press 1 to next order and 0 to exit: __1
here is what i have done so far, i really dont know how to put the if and else statement
//// import java.util.Scanner; public class courseWork { static int no_starter, no_mainCourse, no_desert, no_softDrink, no_coffee ; public static void main(String[] args) { int input; Scanner stdio = new Scanner( System.in ); double Total = 0; // Total value of all the orders. /* Ask the user for the number of each type of course. */ System.out.println("Do you want to order starter? "); input = stdio.nextInt(); if(input == 1){ System.out.print("Enter the number of starter: "); no_starter = stdio.nextInt(); stdio.nextLine();} System.out.println("Do you want to order main course?"); input = stdio.nextInt(); if(input == 1){ System.out.print("Enter the number of main course: "); no_mainCourse = stdio.nextInt(); stdio.nextLine(); } System.out.println("Do you want to order desert?"); input = stdio.nextInt(); if(input == 1){ System.out.print("Enter the number of desert: "); no_desert = stdio.nextInt(); stdio.nextLine(); } System.out.println("Do you want to order soft drink?"); input = stdio.nextInt(); if(input == 1){ System.out.print("Enter the number of soft drink: "); no_softDrink = stdio.nextInt(); stdio.nextLine(); } System.out.println("Do you want to order coffee? "); input = stdio.nextInt(); if(input == 1){ System.out.print("Enter the number of coffee: "); no_coffee = stdio.nextInt(); stdio.nextLine(); } /* Add up the prices of the ordered courses. */ double p_starter=(3*no_starter), p_mainCourse=(6*no_mainCourse), p_desert=(4*no_desert) , p_softDrink=(1.5*no_softDrink), p_coffee=(2*no_coffee);