Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Below is a java question/prompt: It is 2 years from today. March 2021. You are, as usual, sitting in a restaurant, but, this time, in

Below is a java question/prompt:

It is 2 years from today. March 2021. You are, as usual, sitting in a restaurant, but, this time, in the staff only area. You are recently assigned the responsibility of managing customers' reservations, and you are thinking about the path that to took you here, and not the consultancy firm that you always dreamed about working at. You keep going back in time, and your thoughts take you to February 2019. You think about the days that you were at your best in everything. Acing every course in your MIS program, and specially the MIST 4600. You think about the day that you thought to yourself, "I have done this good so far, and no way I won't get an A in this course." And, you remember that it was the exact moment that you stopped trying. You close your eyes, struggling with the idea of what if you had kept doing your best in that course, and in that exact moment, a pink elephant enters the room. The pink elephant approaches you and empties every last drop of water in her trunk on your head. You open your eyes and say hi to the pink elephant. "What brings you here today, pink elephant," you ask her. She gives you an answer that makes you to go behind your laptop and do this assignment. She says: "Now that your poor performance in MIST 4600 changed your destiny, why not using one of the few things that you learned and make your life easier. Why not writing a reservation management program that can assist you in managing reservations?"

You start developing your restaurant reservation management system. This program should allow you to keep registering customers reservations until 5pm, which is when the restaurant opens for dinner. On a typical day, you should receive at most 100 phone calls. For every customer, you receive a last name, a size of party, and a time of reservation. You want to be able to enter everything in one line. For example, "Rahmati 29 11". It means that Rahmati has called you and has made a reservation for 29 people at 11pm. Your restaurant receives reservations only at the beginning of the hour (5, 6, 7, 8, 9, 10, 11). The restaurant closes at 11:30pm.

Once it is 5pm, or you already have the 100 reservations for that day, you want to be able to enter "stop" and your program should allow you choose between three modes, by typing in "exec" or "stats" or "print".

In the print mode, your program should print the below line for every customer who has a reservation. So, if you have 10 reservations for that day, 10 lines like this should be printed:

[FirstName], [partySize], [time] 

In the "exec" or execution mode, you want to be able to search the names of customers as they arrive, and add a "" at the beginning of their last name. In this mode, you should be able to enter the exact name, and a "" will be added right before the name of the person. (Assume that there are no duplicates in the list.) Once you enter "stop", your program should exit this mode.

In the "stats" mode, you should be able to give three types of commands:

  • The first command is search customer last name. To give this command, you enter a line such as "1 Rah", and your program prints the information for all of customers whose last name starts with "Rah" and have not arrived at the restaurant yet (i.e. no "*" in front of their last name). So, if you have one customer "Bernards 4 8" and another one "Beachamp 2 9", if you enter "1 Be" the below lines will be printed to the console:
Bernards, 4, 8 Beachamp, 2, 9 
  • The second command is for receiving some basic statistics about the party sizes. You want to be able to just enter "2" and have the average party size, and the maximum party size to be printed to the console:
Average: [calculated average] Maximum: [the maximum] 
  • And finally, you want to be able to receive the full list of every reservation (whether the customer has or has not arrived) at or after a certain time. For this command you should enter 3 following by a space and the time. For example for receiving the list of customers who have reservations after 10pm, you should be able to enter "3 10" or for customers who have reservations after 9pm "3 9". For example, if you only have Rahmati, Bernards and Beachamp in the previous part, and you enter "3 9", the below lines should be printed to the console:
Rahmati, 29, 11 Beachamp, 2, 9 

Your program should go back to mode selection when it receives a "4 stop" or just a "4" command. You should be able to go to different modes. For example, you should be able to enter "print", and have the reservations printed, and then enter "exec" and then Once your enter "stop" in the mode selection mode, your program should stop. You can store and print the reservations in the order that you register them. You don't need to reorder or sort them.

Note: Prompt the user appropriately, so you won't get confused while answering the calls!

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

Excel 2024 In 7 Days

Authors: Alan Dinkins

1st Edition

B0CJ3X98XK, 979-8861224000

More Books

Students also viewed these Databases questions

Question

4. Describe cultural differences that influence perception

Answered: 1 week ago