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....
-
1. Can we realistically expect parents to be able to fully shield their children from indecent broadcasting? 2. Should parents do so? Explain. Caroline Fredrickson explained the American Civil...
-
Professional codes of ethics: a. Are uncommon in professions other than public accounting. b. Mandate ideal standards of behavior. c. Are enforceable if based in standards of ideal behavior. d....
-
Place the corresponding letter of the definition next to the term. a. An organization that stands as a separate economic unit must not have its financial affairs confused with that of other entities....
-
Tropical Sun Ltd. makes suntan lotion in two stages. The lotion is rst blended in the Blending Department and then bottled and packed in the Bottling Department. The following information relates to...
-
What is budgeting and what is the function of budgeting? What are the budgets allocation resources and communcation targets used for ? Explain the 3 types of budgets revenue budget, cost budgets, and...
-
You are an Examiner for the Refund Integrity Program in the GST/HST Audit Division of the Canada Revenue Agency (CRA). Using sophisticated analytical tools, you are able to identify GST/HST returns...
-
1. What is the Fraud Triangle? Discuss your understanding of the Fraud Triangle and give examples of financial statement fraud for each of the three elements of the Fraud Triangle: a. Opportunity:...
-
John has taken out a loan for college. He started paying off the loan with a first payment of $ 1 0 0 . Each month he pays, he wants to pay back 1 . 1 times as the amount he paid the month before....
-
The value, A of an investment of a principal is given by the equation below. How long will it take for an investment of $ 5 0 , 0 0 0 to reach a value of $ 7 5 , 0 0 0 at an interest rate of 6 % ?
-
Give an example of where you might use a multivariate function. Indicate the variables and whether you would maximize or minimize the function.
-
If 200,000 is available for investment and 60,000 is invested at 20% per year the remainder is invested at 12% per year. What is the overall rate of return on the 200,000?
-
-. Let a, b, c > 0. Show that b+c a+c a+b + + 3a+b+c a+3b+c a+b+3c IV 5' 620
-
White Lotus Inc. estimated that its manufacturing overhead costs for the year would be $400,000. The company estimated that during the year they would incur 10,000 direct labor hours and 12,000...
-
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?
-
When is the Fixed Asset Manager synchronized with the fixed asset list?
-
What information is provided by the Fixed Asset Managers Depreciation Schedule by G/L Account Number report?
-
Describe the financial accounting journal entry to record the sale/disposal of a fixed asset.
Study smarter with the SolutionInn App