 # Assignment #2 Yoshi’s Pizza Orders Problem Description You...

## Question

Show transcribed text

## Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

import java.util.Scanner;

/**
*
* @author
*/
public class YoshiPizza {

/**
* global constant variables
*/
private static final double COST_PIZZA_SM = 12.75;
private static final double COST_PIZZA_LA = 18.75;
private static final double COST_SALAD_SIDES = 7.25;
private static final double COST_CAN_COLA = 1.75;
private static final double COST_PACKS_COLA = 8.00;
private static final double COST_2L_COLA = 3.75;

//private static final int
private static final String[] ITEMS = {
"Pizza", "Pizza", "Sides", "Cola", "Cola", "Cola"
};
private static final String[] SIZES = {
"Small", "Larges", "Salad", "1 can", "6-pack", "2 L"
};
private static final double[] PRICES = {
COST_CAN_COLA, COST_PACKS_COLA, COST_2L_COLA
};

public static void main(String[] args) {

/**
* constant variables
*
* Declare and use constants for the each of the costs of the different
* items being sold (e.g. COST_PIZZA_SM=12.75, COST_PIZZA_LG=18.75,
* etc.), GST and deposit prices. (No magic numbers!)
*/
final double COST_DEPOSIT_SM = 0.1;
final double COST_DEPOSIT_PACK = COST_DEPOSIT_SM * 6;
final double COST_DEPOSIT_LG = 0.25;
final double GST = 1.05;
final char YES = 'y';
final char PIZZA = 'p';
final char COLA = 'c';
final char SIDES = 's';
final String ONE = "one";
final String TWO = "two";
final String SIX = "six";
final char SMALL = 's';
final char LARGE = 'l';
final char EXIT = 'x';

/**
* variables
*/
Scanner scanner = new Scanner(System.in);
double total = 0;
char selection;
double cost;
double subtotal;
int number;
int numPizzaSM = 0;
int numPizzaLA = 0;
int numSide = 0;
int numColaOne = 0;
int numColaTwo = 0;
int numColaSix = 0;
int numCustomer = 0;

System.out.println(
"******************************************* \n"
+ "*** Welcome to Yoshi's Pizza Restaurant *** \n"
+ "***    Today's date is Jan-31-2020    *** \n"
+ "*******************************************");

do {
// payemnt of the current customer
subtotal = 0;
// loop until the custaomer want to stop
do {
System.out.print("Enter item choice (P - Pizza, "
+ "S - Sides, C - Cola, or X - exit): ");
// get selection

// Use a character data type for the type of purchase
// being made, i.e. the type value will be
// one of p, P, s, S, d or D.
selection = scanner.next().toLowerCase().charAt(0);
// the customer want to stop
if (selection == EXIT) {
// Use a sentinel-controlled loop – stopping when
// the user enters “x” or “X” (for Exit).
// Your program will continue until the order details
// for the final customer of the day have
// been calculated.
break;
}...

By purchasing this solution you'll be able to access the following files:
YoshiPizza.java.

\$21.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

### Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.