Question
The purpose of this assignment is to assess your understanding of initializing arrays, declaring arrays, and searching arrays by creating an application to store entres
The purpose of this assignment is to assess your understanding of initializing arrays, declaring arrays, and searching arrays by creating an application to store entres served at a cafeteria during the work week.
The following are the steps that you should follow:
(1) Create an array of String objects and populate it with the days of the work week (i.e., Monday - Friday)
(2) Create an array parallel to the one created in (1) to store the entres. However, you do not have this information, so you will need to write a loop that prompts the user to enter the entre served on that day. This prompt should include the day for which you are asking for the information (e.g., "What entre is being served on Monday?")
(3) Create another parallel array that stores the prices. You will also need to collect this information from the user. This time, your prompt should include the name of the entre for which you are asking for the price
(4) Prompt the user for an entre and search the array and output the day on which the entre will be served (5) Search through the array for the highest price entre and output the name of this entre for the user
Sample Output:
What entree is being served on Monday? Catfish What entree is being served on Tuesday? Tacos What entree is being served on Wednesday? Lasagna What entree is being served on Thursday? Fried Chicken What entree is being served on Friday? Pizza What is the price for Catfish? 3.87 What is the price for Tacos? 2.15? What is the price for Lasagna? 6.99 What is the price for Fried Chicken? 4.99 What is the price for Pizza? 2.50 Enter an entree to search for: Fried Chicken Fried Chicken is served on Thursday The highest price entree is LasagnaStep 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