Answered step by step
Verified Expert Solution
Question
1 Approved Answer
public class Exercise 0 1 _ StoreOrders { / * in java Sally's Pizza is bringing its pizza ordering system into the digital age to
public class ExerciseStoreOrders
in java
Sally's Pizza is bringing its pizza ordering system into the digital age
to get better customer insights.
They've encoded each of Sally's pizzas and other dishes as an integer:
: small, cheese : medium, cheese : large, cheese
: small, pepperoni : medium, pepperoni : large, pepperoni
: calzone
: spaghetti pie
: baked ziti
You can use these constants in your solutions.
private final int SMALLCHEESE ;
private final int SMALLPEPPERONI ;
private final int MEDIUMCHEESE ;
private final int MEDIUMPEPPERONI ;
private final int LARGECHEESE ;
private final int LARGEPEPPERONI ;
private final int CALZONE ;
private final int SPAGHETTIPIE ;
private final int BAKEDZITI ;
Each customer order, consisting of one or more items, is represented as an array
where each value represents an item in that order.
Create an "order" that contains the following items:
small, cheese SMALLCHEESE
calzone CALZONE
large, pepperoni LARGEPEPPERONI
spaghetti pie SPAGHETTIPIE
Examples:
createOrder
public int createOrder
return new int;
Sally realized that she needed to know how many calzones her shop sells per day.
Implement the logic to count the number of calzones sold per day when given an
array representing each item that her customers ordered that day.
Examples:
getCalzoneSalesCALZONE LARGECHEESE, LARGEPEPPERONI, CALZONE, SMALLCHEESE
which is the same as:
getCalzoneSales
getCalzoneSalesLARGECHEESE, LARGEPEPPERONI, SMALLCHEESE
getCalzoneSales
public int getCalzoneSalesint orders
return ;
Sally also needs to know the total revenue for all cheese pizzas sold on any given day.
Each small cheese pizza costs $
Each medium cheese pizza costs $
Each large cheese pizza costs $
Implement the logic to return the total revenue of all cheese pizzas when given
an array representing each item that her customers ordered that day.
Examples:
getCheesePizzaRevenueSMALLCHEESE
getCheesePizzaRevenueSMALLCHEESE, SMALLPEPPERONI, MEDIUMCHEESE
getCheesePizzaRevenueSMALLPEPPERONI, MEDIUMPEPPERONI
public int getCheesePizzaRevenueint orders
return ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started