Question: Please i need this answer in C language before tomorrow at noon..please read the section thats states we will now modify the code so as

Please i need this answer in C language before tomorrow at noon..please read the section thats states we will now modify the code so as to allow an arbitrary.... and please reply it a working output to show the code works ..Ill really appreciate  Please i need this answer in C language before tomorrow at
noon..please read the section thats states we will now modify the code
so as to allow an arbitrary.... and please reply it a working
output to show the code works ..Ill really appreciate Write a program

Write a program called parkingSimulator.c that contains the folowing main) function int naino Car carl, car2, Parkingtot pl, p2: car3, cars, cars, car, car, care. ca9 // Set up 9 cars initializeCar (&carl, "ABC 123.0) nitialszecar (&ea:2, "ABC 124".0) initializeCar(bear3, "ABD 314", O); initializeCar (&car, "ADE 901 0) initializeCar (&car5,AFR 304", 0) initializeCar (&car6, "AGD 888".0) initializeCar (&car?. "AAA 111"0 initializeca r (6car8, ABB 001", 0); initializecar (car9, "Xz 678", 1) // Set up two parking lots initializelot (&pl, 1, 4, 5.5. 20.0 initalizeLot (4p2, 2. 6. 3.0, 12.0) printLotInfo (pi) printLotInfo (p2) printf (" /Simulate cars entering the lots carEnters (spl, carl. 7. 15) carEnters(8p1, &car2, 7,25) carEnters (6p2, &car3, , 0) carEnters (&p2, &car,10) cazEnters(6pl, cars, 8. 15) carEnters (6pl, &car, 8 20) carEnters (pl, car?, 8,30 carEnters (&p2, &car?, 8 32) carEnters (6p2,&car8. 850) earEnters (sp2.ears, 8, 55) ; printf(" printLotinfo (pl) printLotInto (p2) printf(" Simulate cars leaving the lots carLeaves (8p2,6cars. 9, 0 carLeaves (&pl, &car2, 9, 5)a carLeaves (6pl, car6, 10, 0) earLeaves (4p, 6ean, 10, 30) ; carLeaves (sp2, car8. 13. 0) carLeavesp2, cars. 15,15 carLeaves (pl, cars, 17, 50 carLeaves (6p2, &car?, 18. 0 carLeaves (4p2, &car3. 18. 15) carLeaves (6pl 6cars, 20.55) peintfl" printLot Info (pl) printLot Info (p2) printfl"-) // Display the total revenue printfl"Total revenue of Lot 1 1s 994 2.pl.revenue) printf ("Total revenue of Lot 2 is S%4.2f ", p2. revenue); This code simulates a few cars parking in two parking lots. To make it work, you will have to follow the directions below carefully. You MAY NOT alter the main) function code in any way. Follow the teps below and pay attention to the dear directon as to parameter types and what each function should do. Make sure to use comments in your code and make sure that it is neat and organized Just to make one ting clear.even though we wil have mutiple cars parking in the parking lots at this point the parking lot does NOT keep an array of cars .Create a struct called Time that stores an hour and minute amount This ouldbe used to represent a time of day or an amount of time that hars elapsed Create a struct called Car that stores a plateNumber for a car (which must be achar pointer) A singe permit, an entering Time which is a Time struct that indicates the lime Ihat the car entered the lot, and a lotParkedin number which is an int indicating the number oll the lot that the car is parked in. Create a struct called ParkingLot that stores a lotNumber (as an integer) to represent its unique lO, an hourlyRate (a double) represerting the amoune that a car ownerwould pay per hour to be parked in at lot a maxCharge (a double) indicating the maximunm amount that the car owner would pary to park the car for the day an integer capacity representing the maximum number of cars that can park in ht lot, a currentCarCount indicating the number of cars currently parked in the lot, and finally a revenue (a double) that keeps track of the amount ef money taken in by hat lot so far Create the following Time struct related functions ets the hours and mimutes anount for the given time t based othe specitled hours-91-25 hours woold be 3 hu Takes te ie objeets tnet pointers and computes h that difference in the dar Create the following Car struct related funcions // IL tLaLLze the car poLnted t* by e to havt the given plate and vold initLalecar (Car char "plate char hasPei Create the folowing ParkingLot struct related functions tnitialize the lot pointed to by P to have the given sbes rge values vold inleaet arkinLot pntmit cap, Print out the parking lot paraneters so that is sla Parking Lot 82 rate . S3.00, capacity current 64e* 5 Add appeopriate functions called carEnters) and carLeaves0 so that the main method above works correcty and produces the following output results exactly apety eurrent Parking let -.50 capacity ,urest ars 100 pasd 3:0 paid leaves tat 055 91 Parking et 3-te55.5 apacity , ouest as We will now modey he code so as to allow an arbitrary number of cars and parking lots to be used by MUST NOT alter ANY of the functions that you wrote. You willjust areate two new functions and hen alter the main funcion . Create a function caled randomPlateO hat takes no parameters and retums a char The random character from A to Z and # is a tandomoplton 0 to9. The fandom string must be Create a function called randomCaro hat takes no parameters and returns a Car You MUST make use of the randomPlateO and initializC0 functions The pointer to the new Erase the contents of the maing unction Instead, wite the main function code so that it follows the directions on onder) as shown below 1 Make an array to hold pointers to 50 Car and anaray to hold pointers to 5 Parkingto 3. Set up 5 15.20,25 hourlyRates $4,$5 $6, $7,S8 and max charges $12,$14, $16,S18, $20 4. Display the lot info for all parking lots Simulate all 50 cars trying to enter a gandntechee lot starting at 6am such hat each car enters exactly 5 minutes after the previous car entered. Make sure hat each car aftempts to enter a lot by calling the carEnters0 function Display the lot into again for all parking lots Simulase all parked cars trying to leave the lots (use carleaves0) starting at 11am such that each car leaves exactly 5 minutes atter the previous cr left. Make sure that a car has already parked belore you try to simulate i eaving 8. Display the lot into again for all parking lots 9. Display the revenu bral king lots. 0. Free up ALL memory that you had dynamically alocated Use valgrind to ensure that everything was freed properly Ensure that each time you run your oode, you get dfferent random values Here is an example of the output hat you should get 6 of 7 ar X 946 arives at Lot at 10:05 but he ot ia cap cty as- Caz A Car 290 ees Lot5at 1105 pad1. 11:25 paid Car ES3 347 Leares Lot 2 at 12a05 pasd 12.0 Car 3C2 973 Leaes Lot 1 at 1215 paid 10.0 Lot 5 at 12:35 paid $10,05 3120 paid 3 ar LYA 527 ees Eot 2 at 13425 pai 13 1 sa. Car oHE 927 Leares Lot 2 at 1340 pasd 5120 05 pasd 3410 paid 12. Car 938 s ot 2 Lot 3 at 3435 pad 14.0 r BA2 646 eaves Lot a 3445 pasd 300 4:50 pasd s apacity 3 cuent Total reve oral reven $72-0 Write a program called parkingSimulator.c that contains the folowing main) function int naino Car carl, car2, Parkingtot pl, p2: car3, cars, cars, car, car, care. ca9 // Set up 9 cars initializeCar (&carl, "ABC 123.0) nitialszecar (&ea:2, "ABC 124".0) initializeCar(bear3, "ABD 314", O); initializeCar (&car, "ADE 901 0) initializeCar (&car5,AFR 304", 0) initializeCar (&car6, "AGD 888".0) initializeCar (&car?. "AAA 111"0 initializeca r (6car8, ABB 001", 0); initializecar (car9, "Xz 678", 1) // Set up two parking lots initializelot (&pl, 1, 4, 5.5. 20.0 initalizeLot (4p2, 2. 6. 3.0, 12.0) printLotInfo (pi) printLotInfo (p2) printf (" /Simulate cars entering the lots carEnters (spl, carl. 7. 15) carEnters(8p1, &car2, 7,25) carEnters (6p2, &car3, , 0) carEnters (&p2, &car,10) cazEnters(6pl, cars, 8. 15) carEnters (6pl, &car, 8 20) carEnters (pl, car?, 8,30 carEnters (&p2, &car?, 8 32) carEnters (6p2,&car8. 850) earEnters (sp2.ears, 8, 55) ; printf(" printLotinfo (pl) printLotInto (p2) printf(" Simulate cars leaving the lots carLeaves (8p2,6cars. 9, 0 carLeaves (&pl, &car2, 9, 5)a carLeaves (6pl, car6, 10, 0) earLeaves (4p, 6ean, 10, 30) ; carLeaves (sp2, car8. 13. 0) carLeavesp2, cars. 15,15 carLeaves (pl, cars, 17, 50 carLeaves (6p2, &car?, 18. 0 carLeaves (4p2, &car3. 18. 15) carLeaves (6pl 6cars, 20.55) peintfl" printLot Info (pl) printLot Info (p2) printfl"-) // Display the total revenue printfl"Total revenue of Lot 1 1s 994 2.pl.revenue) printf ("Total revenue of Lot 2 is S%4.2f ", p2. revenue); This code simulates a few cars parking in two parking lots. To make it work, you will have to follow the directions below carefully. You MAY NOT alter the main) function code in any way. Follow the teps below and pay attention to the dear directon as to parameter types and what each function should do. Make sure to use comments in your code and make sure that it is neat and organized Just to make one ting clear.even though we wil have mutiple cars parking in the parking lots at this point the parking lot does NOT keep an array of cars .Create a struct called Time that stores an hour and minute amount This ouldbe used to represent a time of day or an amount of time that hars elapsed Create a struct called Car that stores a plateNumber for a car (which must be achar pointer) A singe permit, an entering Time which is a Time struct that indicates the lime Ihat the car entered the lot, and a lotParkedin number which is an int indicating the number oll the lot that the car is parked in. Create a struct called ParkingLot that stores a lotNumber (as an integer) to represent its unique lO, an hourlyRate (a double) represerting the amoune that a car ownerwould pay per hour to be parked in at lot a maxCharge (a double) indicating the maximunm amount that the car owner would pary to park the car for the day an integer capacity representing the maximum number of cars that can park in ht lot, a currentCarCount indicating the number of cars currently parked in the lot, and finally a revenue (a double) that keeps track of the amount ef money taken in by hat lot so far Create the following Time struct related functions ets the hours and mimutes anount for the given time t based othe specitled hours-91-25 hours woold be 3 hu Takes te ie objeets tnet pointers and computes h that difference in the dar Create the following Car struct related funcions // IL tLaLLze the car poLnted t* by e to havt the given plate and vold initLalecar (Car char "plate char hasPei Create the folowing ParkingLot struct related functions tnitialize the lot pointed to by P to have the given sbes rge values vold inleaet arkinLot pntmit cap, Print out the parking lot paraneters so that is sla Parking Lot 82 rate . S3.00, capacity current 64e* 5 Add appeopriate functions called carEnters) and carLeaves0 so that the main method above works correcty and produces the following output results exactly apety eurrent Parking let -.50 capacity ,urest ars 100 pasd 3:0 paid leaves tat 055 91 Parking et 3-te55.5 apacity , ouest as We will now modey he code so as to allow an arbitrary number of cars and parking lots to be used by MUST NOT alter ANY of the functions that you wrote. You willjust areate two new functions and hen alter the main funcion . Create a function caled randomPlateO hat takes no parameters and retums a char The random character from A to Z and # is a tandomoplton 0 to9. The fandom string must be Create a function called randomCaro hat takes no parameters and returns a Car You MUST make use of the randomPlateO and initializC0 functions The pointer to the new Erase the contents of the maing unction Instead, wite the main function code so that it follows the directions on onder) as shown below 1 Make an array to hold pointers to 50 Car and anaray to hold pointers to 5 Parkingto 3. Set up 5 15.20,25 hourlyRates $4,$5 $6, $7,S8 and max charges $12,$14, $16,S18, $20 4. Display the lot info for all parking lots Simulate all 50 cars trying to enter a gandntechee lot starting at 6am such hat each car enters exactly 5 minutes after the previous car entered. Make sure hat each car aftempts to enter a lot by calling the carEnters0 function Display the lot into again for all parking lots Simulase all parked cars trying to leave the lots (use carleaves0) starting at 11am such that each car leaves exactly 5 minutes atter the previous cr left. Make sure that a car has already parked belore you try to simulate i eaving 8. Display the lot into again for all parking lots 9. Display the revenu bral king lots. 0. Free up ALL memory that you had dynamically alocated Use valgrind to ensure that everything was freed properly Ensure that each time you run your oode, you get dfferent random values Here is an example of the output hat you should get 6 of 7 ar X 946 arives at Lot at 10:05 but he ot ia cap cty as- Caz A Car 290 ees Lot5at 1105 pad1. 11:25 paid Car ES3 347 Leares Lot 2 at 12a05 pasd 12.0 Car 3C2 973 Leaes Lot 1 at 1215 paid 10.0 Lot 5 at 12:35 paid $10,05 3120 paid 3 ar LYA 527 ees Eot 2 at 13425 pai 13 1 sa. Car oHE 927 Leares Lot 2 at 1340 pasd 5120 05 pasd 3410 paid 12. Car 938 s ot 2 Lot 3 at 3435 pad 14.0 r BA2 646 eaves Lot a 3445 pasd 300 4:50 pasd s apacity 3 cuent Total reve oral reven $72-0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!