LLL DDDD Write a C program that manages a parking lot with the given specifications below. HTTTTT You are running a free
Posted: Fri Apr 29, 2022 6:39 am
LLL DDDD Write a C program that manages a parking lot with the given specifications below. HTTTTT You are running a free parking service. The parking lot is TTTTTT01011 a 10 x 10 matrix with each parking space corresponding to a spot on the matrix. The top left parking spot is [0][0] TITI in the parking lot and the bottom right is (9)19). See Figure 1. Cars will enter from [0][0] and leave from [9][9). When entering the parking lot, each car takes a ticket. Cars will park on the first empty spot they find. To show that a car has parked in the parking lot you will need to write their ticket number to the appropriate spot in the parking lot matrix. See Figure 2 where cars with tickets TITI 12, 34 and 45 have already parked. Cars can take the ITT 1991 same ticket numbers. Fig 2: Example Parking Fig 1: Parking Lot All empty parking spots should have -1' value. See Figure 3 which is an output image. Your code will start asking for an integer input for commands. Command 'O': Exit the program. You should print out the last state of the parking lot as you exit. Fig 3: Empty Parking Lot Command '1': Print out the current state of the parking lot. Command '2': A new car will enter the parking lot. After this command you need to ask for an input for a new ticket number. The new car will take this ticket and park. 1911 Command '3': A car will leave the parking lot. After this command you need to ask for an input for an existing ticket number. You should find the car with that ticket number and empty its parking spot. If no car with that ticket number is found, you should print out an appropriate message and ask for a new command input (not a new ticket input). If there are more than one car with the same ticket, cars should leave in the reverse order that they came. Welcome You can see how your code should output with the examples Please input your command: below. Note that a different set of samples will be used for testing and grading. Ex. 1: The start of the code 1/2 Please input your command: Please input your command: A car is leaving. Please input the ticket number of the leaving cart Please input your command: A new car is enterine. Please Input a ticket number: Please input your comand: Incorrect comand, new comand needed. Please input your command: A new car is entering. Please input a ticket number: Please input your command: Parking Lot: Goodbye. Here is the final Parking Lot Process returned (0) Press any key to continue execution time: 33.265 S Ex. 3: Car Leaving & Exit Commands Ex. 2: Car Parking & Print Commands Notes on Grading: Your homework will be graded out of 100. Establish a two dimensional array for the parking lot (15 points) In your code you should have a function to print out the current state of the parking lot. (15 points) You should have a function to park a car (15 points) and another function to have a car leave (15 points) The handling of commands is worth 30 points. Appropriate comments and readability of your code (such as indentation) is worth 10 points. Important Notes: The name of your homework file should be "yoursurname_name.c" You should upload your homework to the Moodle system before the given deadline of May 1 2022, Sunday 23:59. • Group study is not allowed. Everyone needs to do their homework as an individual. • Cheating will NOT be tolerated. If any case of cheating is detected, at any time, you will get ZERO from your homework and we will initiate a disciplinary act! • A software is used to detect the similarities between submitted codes. If high similarity is detected, then both parties will be graded as 0. Late submissions will NOT be graded. There will be no extensions. •