Question: 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.

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. Create an array of orders, and fill it with the respective Order enum values according to b. 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 CICED_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: (totalMake Time / numBaristas) + (numOrders % numBaristas) 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. This function should call 200 kupMakeTime to calculate the totalMakeTime 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 parameter, 2. In the main method: a Welcome your user to the coffee shop by printing "Welcome to your local coffee shop! What does the rush look like today?" followed by a new line to the console b C Create a Scanner to take in their order input using the nextLine() method Call the createOrderArray method to get an array of Orders. d. Call the computeOrderMakeTime method three times with 1, 2 and 3 as their respective parameters
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
