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...
write a C++ program to CREATE A CLASS EMPLOYEE WITH YOUR CHOICE OF ATTRIBUTES AND FUNCTIONS...
write a C++ program to CREATE A CLASS EMPLOYEE WITH YOUR CHOICE OF ATTRIBUTES AND FUNCTIONS COVERING THE FOLLOWING POINTS: 1) COUNTING NUMBER OF OBJECTS CREATED ( NO OBJECT ARRAY TO BE USED) USING ROLE OF STATIC MEMBER 2) SHOWING THE VALID INVALID STATEMENTS IN CASE OF STATIC MEMBER WITH NON STATIC MEMBER FUNCTION, NON STATIC MEMBERS OF CLASS WITH STATIC MEMBER FUNCTION, BOTH STATIC. SHOW THE ERRORS WHERE STATEMENTS ARE INVALID. 3) CALL OF STATIC MEMBER FUNCTION, DECLARATION OF...
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...
Please create an Event-Based JavaScript Program of your choice. Please write new code for this project...
Please create an Event-Based JavaScript Program of your choice. Please write new code for this project (starting from scratch). Thank you!!
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.
Question 1: Review the performance of a country/business of your choice in the way that it...
Question 1: Review the performance of a country/business of your choice in the way that it handled the Coronavirus outbreak. Identify three areas of underperformance, recommend solutions and suggest how they could implement any changes. Country/Business: ___________________ Underperformance Recommended Solutions Suggest how changes could be made Question 2: When designing a training program for a company of your choice (eg a café), identify at least five tasks/processes etc that should be trained, and then list what resources that you might...
Isolating bits and bytes Task: Create a program that manages an IP address. Allow the user...
Isolating bits and bytes Task: Create a program that manages an IP address. Allow the user to enter the IP address as four 8 bit unsigned integer values (just use 4 sequential CIN statements). The program should output the IP address upon the users request as any of the following. As a single 32 bit unsigned integer value, or as four 8 bit unsigned integer values, or as 32 individual bit values which can be requested as a single bit...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT