Question: import java.util.Scanner; import java.text.DecimalFormat; public class Pizzaproject { public static void main ( String [ ] args ) { DecimalFormat cash = new DecimalFormat (
import java.util.Scanner;
import java.text.DecimalFormat;
public class Pizzaproject
public static void mainString args
DecimalFormat cash new DecimalFormat;
Scanner keyboard new ScannerSystemin;
Pizza order new Pizza;
String firstName;
boolean discount false;
int inches;
char crustType;
double price;
final double TAXRATE ;
double tax;
char choice;
String input;
String toppings "Cheese ;
int numberOfToppings ;
if inches
order.setSize;
order.setPrice;
else if inches
order.setSize;
order.setPrice;
else if inches
order.setSize;
order.setPrice;
else if inches
order.setSize;
order.setPrice;
else
System.out.printlnInvalid size entered.";
keyboard.close;
System.out.println default inch pizza is served if customer not select";
order.setSize ;
order.setPrice ;
keyboard.nextLine ;
System.out.println What type of crust do you need? ;
System.out.print P Pan, C crustregular, or
G crustglutenfree enter T C or G: ;
input keyboard.nextLine;
switch crustType
case P:
case p:
order.setCrust Pan;
Break;
case C:
case c:
order.setCrust Crustregular";
break;
case G:
case g:
order.setCrust crustglutenfree ;
break;
default:
System.out.println default pan pizza is served if customer not selects;
order.setCrust crustglutenfree ;
System.out.println Every pizza comes with cheese.";
System.out.println Extra toppings are each,"select from";
System.out.println Sardines Pepperoni, Diced Onion, Sliced Mushroom";
System.out.print Do you want Sardines? YN: ;
input keyboard.nextLine;
Select input.charAt ;
if select Y select y
NumberOfToppings ;
toppings toppings "Sardines";
System.out.print Do you want Pepperoni? YN: ;
Select input.charAt;
if select Y select y
numberOfToppings ;
toppings toppings "Pepperoni ;
System.out.print Do you want Diced Onion? YN: ;
Select input.charAt ;
if select Y select y
numberOfToppings ;
toppings toppings "Diced Onion ;
toppings toppings "Diced Onion ;
System.out.print Do you want Sliced Mushroom? YN: ;
Select input.charAt;
if select Y select y
numberOfToppings ;
toppings toppings "Sliced Mushroom ;
order.setNumToppings numberOfToppings;
order.setToppingList toppings;
order.setPricenumberOfToppings;
System.out.println ;
System.out.println Your order is ready: ;
System.out.println ordergetSize inch pizza";
System.out.println ordergetCrust crust";
System.out.println ordergetToppingList;
if discounttrue
System.out.print User is eligible for discount. ;
order.setPrice ;
Price order.getPrice ;
System.out.println The price of your order is: cash. Format price;
Tax price TAXAMOUNT;
System.out.println The tax is: cash.format tax;
System.out.println The total due is: cash. Format tax price;
System.out.println Pizza is to be cooked" For pickup in minutes.";
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
