Question

In: Computer Science

Question 1. Your task is to create a full program for a Restaurant of your choice....

Question 1. Your task is to create a full program for a Restaurant of your choice. You will have the output appear at first saying Welcome to ______ Restaurant where the _____ will be whatever you name your restaurant

Today’s choices are 1.__________ 2._________ 3._______ 4.________

NOTE each _____ will say an item and its price for example pizza 2.99 Please choose 1 of the choices. In each case, as the user picks a choice It will calculate the total cost of the item based on a tax of 8.5%(multiply cost by 0.085) and add to original cost It will output what the user chose and the total cost for the bill in correct money format IF the user enters in something other than 1 through 4 it will say. INVALID CHOICE and the cost will be $0.00 It will then say. Thank You and have a nice day!

Solutions

Expert Solution

Hey , because no language specified I am using JAVA langauge to code it.

--------------------------------------------------------------------------------

file-name:     Main.java
---------------------------------
import java.util.Scanner;

/*
 *  We continuously loop through the menu and ask user to enter his choice.
 * If user enters the valid choice, that porder price is added to totalPrice ( and it is declared as static )
 * And every time, customer places an order, it will show the current bill amount
 *
 * If the customer enters INVALID number, then we exit from the loop and show the total price
 *
 * If the user input is INVALID in the first iteration itself, then totalprice is shown as 0$.
 */
public class Main {
    static double totalPrice;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        while(true) {
            System.out.println("Today's choices are: ");
            System.out.println("\t1. Pizza   3$ ");
            System.out.println("\t2. Veg Burger 5$");
            System.out.println("\t3. Biryani 70$ ");
            System.out.println("\t4. Chicken Soup 25$ ");

            System.out.println("--------------");
            System.out.print("Enter your choice: ");
            int choice = sc.nextInt();

            switch(choice) {
                case 1:
                    calculatePrice(3);
                    break;
                case 2:
                    calculatePrice(5);
                    break;
                case 3:
                    calculatePrice(70);
                    break;
                case 4:
                    calculatePrice(25);
                    break;
                default:
                    System.out.println("INVALID CHOICE");
                    System.out.println("Total price: "+totalPrice+"$");
                    System.out.println("THANK YOU! AND HAVE A NICE DAY ");
                    System.exit(0);
            }
        } // END of while

    } // END of main( ) method

    public static void calculatePrice(double Price) {
        totalPrice = totalPrice + Price;
        System.out.println("ordered successfully and current total is: "+totalPrice);
    }
} // END 

--------------------------------------------------------------------------------------------------------------------------

OUTPUT:

If the user chooses INVALID option in the first iteration itself, then

Hey, If you expected anything else please comment below the answer, I will modify it accordingly. THANK YOU!! If you like please UPVOTE.


Related Solutions

For this problem you will create a paired-dependent sample. Select a fast-food restaurant of your choice...
For this problem you will create a paired-dependent sample. Select a fast-food restaurant of your choice and ask 8 family/friends to answer the following two questions: 1) On a scale of 1-10, how much do you like to eat fast food? 2) On a scale of 1-10, how much do you like (your chosen restaurant)? (a) Write down your respondents’ answers in a table. (b) Create a column of the differences between your respondents’ answers. (c) Complete a hypothesis test...
Creation of Program Application (Development Task 1) This program should create two output files. You may...
Creation of Program Application (Development Task 1) This program should create two output files. You may use .txt files. Create the following files: Deposists.txt Withdrawls.txt 1. The program application should have the following inputs: Amount for Deposits (Only Accept Positive Amounts) Amount for Withdrawals (Only Accept Positive Amounts). The subsequent program will subtract the positive amount. 2. The program application should have the following outputs: Deposists.txt Withdrawals.txt Total of Deposits and Withdrawals back to the console
Apply internal quality concept on a restaurant of your choice
Apply internal quality concept on a restaurant of your choice
Change Calculator Task: Create a program that will input a price and a money amount. The...
Change Calculator Task: Create a program that will input a price and a money amount. The program will then decide if there is any change due and calculate how much change and which coins to hand out. Coins will be preferred in the least number of coins (starting with quarters and working your way down to pennies). Input: total_price, amount_tender allow the user to input 'q' for either value if they want to quit the program Validate: total_price cannot be...
Create a game of your choice that involves the following concepts:
C++ PROJECTCreate a game of your choice that involves the following concepts:STL library. (Maps, Sets, Lists, Stacks and Queues), with Iterators and AlgorithmsShow especially Especially Algorithm/Iterators/Containers in the STLMinimum of 750 linesInclude Full documentation
Task Description:  Create a referral letter for the following patient using Microsoft word & Full Block Style...
Task Description:  Create a referral letter for the following patient using Microsoft word & Full Block Style . Patient: Lisa Duck Dentist: Dr. Harry DDS, M.S  Address ... Radiograph Findings: Impacted third molars, mild bone loss around max and mandibular molars. Fractured amalgam on the mandibular left first molar Oral Examination Findings: Confirmed mild periodontitis, fractured amalgam, Class III Mobility on 37 electrical shock like pain that radiates to his lower lip when tooth clenched.
What will your statement of interest look like for your program of choice?
What will your statement of interest look like for your program of choice?
C++ program homework question 1 1. Create and implement a class called clockType with the following...
C++ program homework question 1 1. Create and implement a class called clockType with the following data and methods (60 Points.): Data: Hours, minutes, seconds Methods: Set and get hours Set and get minutes Set and get seconds printTime(…) to display time in the form of hh:mm:ss default and overloading constructor Overloading Operators: << (extraction) operator to display time in the form of hh:mm:ss >> (insertion) operator to get input for hours, minutes, and seconds operator+=(int x) (increment operator) to...
WRITE A JAVA PROGRAM TO IMPLEMENT THE CONCEPT OF INDEX (Create index in text file) full...
WRITE A JAVA PROGRAM TO IMPLEMENT THE CONCEPT OF INDEX (Create index in text file) full code
question 1 ) explain these eight determinants of customer restaurant selection in your own words? 1....
question 1 ) explain these eight determinants of customer restaurant selection in your own words? 1. Location 2. Menu item differentiation 3. Price acceptability and value 4. Decor and lighting 5. Portion sizes 6. Product quality 7. Service standards 8. Menu diversity
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT