PizzaOrder Assignment Working Coding
PizzaOrder Assignment Working Coding
//Using ArrayList
System.out.println("Hello " What size pizza would you like? 1:large = 14.99" +
//records users pizza size
" 2: medium = 12.99 3:small = 10.99");
pizza = sc.nextInt(); //grab int relative to pizza cost
if (pizza == 1) {
pizzaSize = "Large";
pizzaPrice = 14.99; //gather pizza int and convert to double
}
if (pizza == 2) {
pizzaSize ="Medium";
pizzaPrice = 12.99;
}
if (pizza == 3) {
pizzaSize ="Small";
pizzaPrice = 10.99;
}
double toppingPrice = 0;
} while (topping < 5); //get the topping Int, aslong as its under 5 loop will
continue to run
if (delivery.equals("yes")) {
System.out.println("Hello" " here is your order:" +"\n" + pizzaPrice +
"\nToppings:" + toppingPrice + "\ndelivery 2.50"
+ "\nTotal cost "+ totalCost );//invoice if user types in yes
}
if (delivery.equals("no")) {
System.out.println("Hello"+" " + name + " here is your order:" +"\n" +
pizzaPrice +
"\nToppings:" + toppingPrice +
"\nTotal cost: "+ totalCost1 ); //invoice if user types in no
}