Q3) In a shopping mall, the parking garage contains a single lane that holds up to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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] 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]
Expert Answer:
Related Book For
College Algebra Graphs and Models
ISBN: 978-0321845405
5th edition
Authors: Marvin L. Bittinger, Judith A. Beecher, David J. Ellenbogen, Judith A. Penna
Posted Date:
Students also viewed these algorithms questions
-
Time-For-Us has set up a booth in a shopping mall to sell calendars during the holiday season. The business can purchase the calendars for $2.69 each. It plans to set the unit price at $9.99. During...
-
Marcie owns a 10 percent interest in a shopping mall located in Portland, Maine. Her adjusted basis for her interest is $250,000, and its fair market value is $900,000. She exchanges it for...
-
Arrivals at a walk-in optometry department in a shopping mall have been found to be Poisson distributed with a mean of 2.5 potential customers arriving per hour. If x 5 number of arrivals during a...
-
The symmetrical three-phase load is A-connected, with Z-(4+ j3) 22 and the phase voltage 220 V, find IL, IP, UL and P of the three loads. 7.(10 score) The symmetrical three-phase load is Y-connected....
-
An investment requires an initial outlay of $45 000. Net returns are estimated to be $14 000 per year for eight years. Determine the rate of return.
-
Erica Mendez, a beginning accounting student, believes debit balances are favorable and credit balances are unfavorable. Is Erica correct? Discuss.
-
While the electromagnetic interaction between the photons and the charged electrons and positrons kept them in equilibrium with each other during the early universe, show that the direct...
-
Draw a document flowchart to depict each of the following situations. a. An individual from the marketing department of a wholesale company prepares five copies of a sales invoice, and each copy is...
-
Two transverse sinusoidal waves combining in a medium are described by the wave functions V = 5.00 sin[(x + 0.300t)] Y25.00 sin[(x -0.300)] where x, y, and y are in centimeters and t is in seconds....
-
Assume the following data for Animal Transport Company REFERENCE REVENUE BUDGET Requirement Prepare a cash budget for April for Animal Transport. Begin the cash budget by calculating the cash...
-
Smooth muscles are (a) Involuntary, cylindrical, striated (b) Voluntary, spindle-shaped, uninucleate (c) Involuntary, fusiform, non-striated (d) Voluntary, multinucleate, cylindrical
-
The answers below were said to be wrong. So, give the CORRECT answers and show COMPLETE solution. Material Costs: Material Cost 175.35 Rattan 92.45 Wires 31.50 Operational Cost 55.00 Abaca 51.40...
-
Starting with vertex v1, trace through Dijkstra's algorithm: 1 2 3 4 5 6 1 0 4 00 15 2 2 4 0 9 3 4 00 3 0 80 1 x 4 6 0 1 0 5 99 5 0 3 6 4 0 1 2 3 4 5 6 nearest distance 1 1 1 1 1 1 Iteration #1:...
-
What are at least five labeling words associated with your gender that you find offensive (chick, babe, boy, hunk are examples). Why are these terms offensive to you? What does the "other person" not...
-
In the xy-plane, the point (0, 2) is on the curve C. If d = for the curve, which of the following statements is true? 3y
-
How does art disprove the assumption that desirability and pleasure are inseparable? Relate this to the quote from G.E. Moore: "We naturally prefer a world of natural beauty over an ugly world even...
-
12. Draw the directed graph represented by the given adjacency matrix adj and the data matrix data. <7> Adi = 1100 00101 00010 00011 01000 data E
-
Which of the following is FALSE regarding the purchasing power parity (PPP). a. The PPP is a manifestation of the law of one price b. The PPP says that a country with a higher expected inflation can...
-
What does Descartes' rule of signs tell you about the number of positive real zeros and the number of negative real zeros of each of the following polynomial functions? a. f (x) = 2x6 - 7x3 + x2 - x...
-
To create a college fund, a parent makes a sequence of 18 yearly deposits of $2000 each in a savings account on which interest is compounded annually at 2.8%
-
Is it possible for a quadratic function to have one real zero and one imaginary zero? Why or why not?
-
(a) Determine the coherence area for a mercury arc lamp at 6330 at a distance of \(1 \mathrm{~m}\) from the source. Assume that the output aperture is \(3 \mathrm{~mm}\) and that the beam is...
-
Assume an InGaAsP-InP laser diode that has a resonator cavity equal to \(250 \mu \mathrm{m}\). The peak radiation is at \(\lambda=1.55 \mu \mathrm{m}\). The refractive index of InGaAsP is 4. The...
-
Let \(\boldsymbol{x}\) be a random variable with a standard normal distribution \(\varphi(t)\). Find (a) (b) P{0 x 1.42}. P{-0.73x0}. (c) P{-1.37 x2.01}. (d) (e) (f) (g) P{0.65 x 1.26}....
Study smarter with the SolutionInn App