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 • I – 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.
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
• I – 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.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images