Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Fast Food Point of Sale (POS) System You have been hired to create the point of

ID: 3645888 • Letter: F

Question

Fast Food Point of Sale (POS) System

You have been hired to create the point of sale (POS) system for a new fast food restaurant. The restaurant has a limited menu -- Hamburgers, Chicken Sandwiches, and Fish Sandwiches. Each may be purchased separately or as part of a Combo that includes fries and a drink. Combos may be Supersized to include a larger order of fries and an extra large drink. The table below gives the price for each type of order:

Meal Sandwich Combo Supersize
Hamburger $ 2.50 $ 4.50 $ 5.00
Chicken Sandwich $ 3.00 $ 5.00 $ 5.50
Fish Sandwich $ 2.75 $ 4.75 $ 5.25

Requirements

You will write a program named FastFoodPOS.
It must display a header that lists the name of the application -- you may name the application as you like -- and provides instructions about using the program. For example,


Welcome to Wolfpack Fast Food POS!
When prompted, please enter the number of meals to be purchased, the type
of each meal -- H (Hamburger), C (Chicken Sandwich), or F (Fish Sandwich) -- and
whether or not it is a Combo. If it is a Combo, you will be prompted as to whether
or not it should be Supersize. The total cost of the meals will then be displayed.


The user should be prompted for the following input values:

The number of meals to purchase. For each meal the user should be prompted for
The meal type (H, C, F). Both uppercase and lowercase characters should be accepted.
If the meal is a Combo (y, n). A yes answer should be assumed if the user enters anything that starts with y or Y. Any other response is considered to be a no answer. If the meal is a Combo, the user should be prompted for
If the Combo should be Supersize (y, n). A yes answer should be assumed if the user enters anything that starts with y or Y. Any other response is considered to be a no answer.

The program should then output the total cost of the meals formatted as a monetary amount, for example, $12.25.

Explanation / Answer

Please rate...

If any problem message me or you can contact me in my email:mailmesandeeppradhan@gmail.com

program:

===================================================================

import java.util.Scanner;
class FastFoodPOS
{
    public static void display()
    {
        System.out.println("Welcome to Wolfpack Fast Food POS!");
        System.out.println("When prompted, please enter the number of meals to be purchased, the type");
        System.out.println("of each meal -- H (Hamburger), C (Chicken Sandwich), or F (Fish Sandwich) -- and");
        System.out.println("whether or not it is a Combo. If it is a Combo, you will be prompted as to whether");
        System.out.println("or not it should be Supersize. The total cost of the meals will then be displayed. ");
    }
    public static void getInput()
    {
        Scanner s=new Scanner(System.in);
        Scanner s1=new Scanner(System.in);
        int n=1,i,t=0;
        String c="h",co,su;
        boolean cob=false,sub=false;
        while(true)
        {
            if(n==0)break;
            System.out.print(" Number of meals to purchase: ");
            n=s.nextInt();
            if(n<0){System.out.println("Invalid input, try again. ");continue;}
            while(true)
            {
                if(n==0)break;
                System.out.print(" H (Hamburger), C (Chicken Sandwich), or F (Fish Sandwich)?: ");

                c=s1.nextLine();
                if(c.equals("H")||c.equals("h")||c.equals("c")||c.equals("C")||c.equals("F")||c.equals("f"))
                {
                    System.out.print("Combo? (y/n): ");
                    co=s1.nextLine();
                    if(co.equals("Y")||co.equals("y")||co.equals("yes")||co.equals("Yes")||co.equals("Yazoo")||co.equals("yazoo"))
                    {
                        cob=true;
                        System.out.print("Supersize? (y/n): ");
                        su=s1.nextLine();
                        if(su.equals("Y")||su.equals("y")||su.equals("yes")||su.equals("Yes")||su.equals("Yazoo")||su.equals("yazoo"))
                        sub=true;
                        else sub=false;
                    }
                    else cob=false;
                    t=t+getMealCost(c.charAt(0),cob,sub);
                    System.out.println(t);
                    n--;
                }
                else if(!c.equals("H")&&!c.equals("h")&&!c.equals("c")&&!c.equals("C")&&!c.equals("F")&&!c.equals("f"))
                {
                    System.out.println("Invalid input, try again. ");
                }
            }
        }
        double total = t/100.0;
        System.out.printf(" Total: $%.2f ", total);
    }
    public static int getMealCost(char mealType, boolean isCombo, boolean isSupersize)
    {
        if(!isCombo && !isSupersize)
        {
            if(mealType=='H'||mealType=='h')return 250;
            if(mealType=='C'||mealType=='c')return 300;
            if(mealType=='F'||mealType=='f')return 275;
        }
        if(isCombo && !isSupersize)
        {
            if(mealType=='H'||mealType=='h')return 450;
            if(mealType=='C'||mealType=='c')return 500;
            if(mealType=='F'||mealType=='f')return 475;
        }
        if(isCombo && isSupersize)
        {
            if(mealType=='H'||mealType=='h')return 500;
            if(mealType=='C'||mealType=='c')return 550;
            if(mealType=='F'||mealType=='f')return 525;
        }
        return 0;
    }
    public static void main(String args[])
    {
        display();
        getInput();
    }
}