Create a program that simulates a parking lot consisting of two alleys Alley A and Alley B, each of which is wide enou for only one car and closed at one end. (See illustration below) Alley A is the primary parking location while alley B used only as a place to move cars out of the way when retrieving a car parked in the middle of Alley A. Progra execution starts with both alleys empty. Assume that both alleys can contain at most max cars. Alley A Alley B The actions to be performed are the following: To park a car, the program accepts the license plate number of the car and parks the car in Alley A, if alley A not full. If alley A is already full, the car has to be turned away. To retrieve a car, the program asks for the license plate number of the car to be retrieved. Then each car in Al A has to be move to alley B until it finds the desired car (and removes it from alley A). All cars that we temporarily placed in alley B are move back to alley A. (D] isplay cars parked in Alley A. (P] ark a car. (R] etrieve a car. (Q) uit the program ID] isplay cars parked in Alley A. [P| ark a car. IR] etrieve a car. IQ] uit the program What would you like to do? D Number of cars remaining in alley A: 5 License plate numbers of cars in alley A: What would you like to do? R Enter license plate number. BND 007 Thank you. NLV 123 (open end] MML 114 LJK 019 BND 007 UMR 941 (closed end] (D] isplay cars parked in Alley A. [P] ark a car. (R] ctrieve a car. IQ) uit the program What would you like to do? P Enter license plate number: MXB 877 Alley A is already full. Sorry.
Create a program that simulates a parking lot consisting of two alleys Alley A and Alley B, each of which is wide enou for only one car and closed at one end. (See illustration below) Alley A is the primary parking location while alley B used only as a place to move cars out of the way when retrieving a car parked in the middle of Alley A. Progra execution starts with both alleys empty. Assume that both alleys can contain at most max cars. Alley A Alley B The actions to be performed are the following: To park a car, the program accepts the license plate number of the car and parks the car in Alley A, if alley A not full. If alley A is already full, the car has to be turned away. To retrieve a car, the program asks for the license plate number of the car to be retrieved. Then each car in Al A has to be move to alley B until it finds the desired car (and removes it from alley A). All cars that we temporarily placed in alley B are move back to alley A. (D] isplay cars parked in Alley A. (P] ark a car. (R] etrieve a car. (Q) uit the program ID] isplay cars parked in Alley A. [P| ark a car. IR] etrieve a car. IQ] uit the program What would you like to do? D Number of cars remaining in alley A: 5 License plate numbers of cars in alley A: What would you like to do? R Enter license plate number. BND 007 Thank you. NLV 123 (open end] MML 114 LJK 019 BND 007 UMR 941 (closed end] (D] isplay cars parked in Alley A. [P] ark a car. (R] ctrieve a car. IQ) uit the program What would you like to do? P Enter license plate number: MXB 877 Alley A is already full. Sorry.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Do it in python
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 3 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY