Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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,

image text in transcribedimage text in transcribed

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: 1. (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 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. Create a Scanner to take in their order input using the nextLine() method. C. 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. 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions