Pizza Order
Pizza Order
/**
*/
// Declare variables
firstName = firstName.trim().toLowerCase();
if (firstName.equals("judy") || firstName.equals("sam")) {
discount = true;
System.out.println(" 8 $10.99");
System.out.println(" 10 $12.99");
System.out.println(" 16 $14.99");
System.out.println(" 20 $16.99");
inches = keyboard.nextInt();
// Task #2: Set price and size of pizza ordered based on choice
if (inches == 8) {
cost = 10.99;
cost = 12.99;
cost = 14.99;
} else {
inches = 10;
cost = 12.99;
keyboard.nextLine();
input = keyboard.nextLine();
crustType = input.charAt(0);
// Task #3: Set user's crust choice on pizza ordered using a switch
statement
switch (Character.toLowerCase(crustType)) {
case 'h':
crust = "Hand-tossed";
break;
case 't':
crust = "Thin-crust";
break;
case 'n':
break;
default:
break;
// Ask user about each topping and add to the order if selected
input = keyboard.nextLine();
choice = input.charAt(0);
numberOfToppings += 1;
input = keyboard.nextLine();
choice = input.charAt(0);
input = keyboard.nextLine();
choice = input.charAt(0);
numberOfToppings += 1;
input = keyboard.nextLine();
choice = input.charAt(0);
numberOfToppings += 1;
System.out.println();
System.out.println(toppings);
if (discount) {
keyboard.close();