Question
How do you do number 3? I'm stuck on that question and I just need help for that question. The class name is CoffeeShop. Create
How do you do number 3? I'm stuck on that question and I just need help for that question. The class name is CoffeeShop.
Create a static method called computeOrderMakeTime. This function should take in an array of Orders and an int called numBaristas representing the number of baristas. It will not return anything. d. Calculate the amount of time it will take the passed in number of baristas to make the orders using the following formula: i. (totalMakeTime / numBaristas) + (numOrders % numBaristas) ii. Where totalMakeTime is the sum of every Orders make, numBaristas is the number of baristas passed in, and numOrders is the number of orders. iii. This function should call lookupMakeTime to calculate the totalMakeTime e. Print out this result as It will take {time} minutes for {numBaristas} baristas to make these orders. where {time} is the double value calculated from the formula above and {numBaristas} is the value of the functions int parameter.
Order.java 1. Create an enumeration (enum) named Order with these values: a. LATTE b. COFFEE C. ICED_COFFEE d. FRAPPE e. PASTRY CoffeeShop.java 1. Create a static method called createOrderArray. This function should take in a string as a parameter and return an array of Orders. a. The string will be formatted like "LCIFPLLP", each letter representing a different order. There will always be at least 1 letter in the input. For example, "LCIFPLLP" would mean: LATTE, COFFEE, ICED_COFFEE, FRAPPEE, PASTRY, LATTE, LATTE and PASTRY. b. Create an array of Orders, and fill it with the respective Order enum values according to L-LATTE C-COFFEE 1- ICED_COFFEE F-FRAPPE P-PASTRY For the example above the string "LCIFPLLP"), the array should contain eight orders, with a LATTE first, COFFEE second, ICED_COFFEE third, FRAPPEE fourth, PASTRY fifth, LATTE sixth, etc. c. Return the newly created array. 2. Create a static method named lookupMakeTime that takes in an Order enum value and using a switch statement returns a double representing how long that type of coffee takes to make. a. LATTE: 3.0 b. COFFEE: 0.5 C. ICED_COFFEE: 2.0 d. FRAPPE: 6.0 e. PASTRY: 3.0 3. Create a static method called computeOrderMakeTime. This function should take in an array of Orders and an int called numBaristas representing the number of baristas. It will not return anything. d. Calculate the amount of time it will take the passed in number of baristas to make the orders using the following formula: i. (totalMakeTime / numBaristas) + (numOrders % numBaristas) ii. Where totalMakeTime is the sum of every Order's make, numBaristas is the number of baristas passed in, and numorders is the number of orders. iii. This function should call lookupMakeTime to calculate the totalMakeTime e. Print out this result as It will take {time} minutes for {numBaristas} baristas to make these orders." where {time} is the double value calculated from the formula above and {numBaristas) is the value of the function's int parameterStep 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