Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q3) In a shopping mall, the parking garage contains a single lane that holds up to 50 vehicles. However, first 10 locations are dedicated
Q3) In a shopping mall, the parking garage contains a single lane that holds up to 50 vehicles. However, first 10 locations are dedicated to some customers. For the remaining parking places, there is only a single entrance/exit to the garage. If a customer arrives to pick up a vehicle and it is not nearest the exit, all vehicles blocking its path are moved out. The customer's vehicle is driven out and the other vehicles are restored in the same order as they were in original. (you may submit the code in C++ code file or paper) [45 marks] a) Write a C++ program for this problem. Design a simple menu driven interface that lets the user specify [15 marks] 1) Total number of cars currently in the garage 2) Choose the location (number) of the car to exit 3) The interface should tell the steps required to remove the specified car from garage and the final position of all cars. Provide only the functions that will be needed by your implementation. b) What data structure(s) do you think is appropriate for the task? Explain the reason (in 3-4 lines) for your choice. [10 marks] c) Show the working of your program using some sample parking configurations. [10 marks] d) List the time complexity of each function. [10 marks]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
include using namespace std include includ...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
Document Format ( 2 attachments)
635d837e86d97_176326.pdf
180 KBs PDF File
635d837e86d97_176326.docx
120 KBs Word File
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started