Question
Hello experts! Please answer in C. Here is the code. #include #include struct Time { int m_hour; int m_minute; }; struct Car { char* m_plateNumber;
Hello experts! Please answer in C.
Here is the code.
#include
#include
struct Time
{
int m_hour;
int m_minute;
};
struct Car
{
char* m_plateNumber;
char m_permit;
struct Time m_enteringTime;
int m_lotParkedinNo;
};
struct ParkingLot
{
int m_lotNo;
double m_hourlyRate;
double m_maxCharge;
int m_capacity;
int m_currentCount;
double revenue;
};
void setHours(struct Time* t, double hours)
{
int totalminutes = hours * 100;
t->m_hour = totalminutes/60;
t->m_minute = totalminutes % 60;
}
void difference(struct Time t1, struct Time t2, struct Time* diff)
{
int entrytotalMinutes = t1.m_hour * 60 + t1.m_minute;
int exittotalMinutes = t2.m_hour * 60 + t2.m_minute;
int totalHours = (exittotalMinutes - entrytotalMinutes) / 60;
diff->m_minute = (exittotalMinutes - entrytotalMinutes) % 60;
if (totalHours == 0)
{
totalHours = 1;
}
diff->m_hour = totalHours;
}
void initializeCar(struct Car *c, const char *plate, char hasPermit)
{
if (!c)
return;
c->m_plateNumber = (char*)malloc(strlen(plate) + 1);
strcpy(c->m_plateNumber, plate);
c->m_permit = hasPermit;
}
void initializeLot(struct ParkingLot *p, int num, int cap,
double rate, double max)
{
p->m_capacity = cap;
p->m_hourlyRate = rate;
p->m_maxCharge = max;
p->m_currentCount = p->revenue = 0;
p->m_lotNo = num;
}
void carEnters(struct ParkingLot* p, struct Car* c, int hours, int minutes)
{
if (p->m_currentCount == p->m_capacity) {
printf("Car %s cannot get in. ", c->m_plateNumber);
return;
}
struct Time enterTime;
enterTime.m_hour = hours;
enterTime.m_minute = minutes;
c->m_enteringTime = enterTime;
p->m_currentCount++;
printf(" Car %s enters Lot %d at %d:%d.", c->m_plateNumber, p->m_lotNo, hours, minutes);
if (p->m_currentCount == p->m_capacity)
{
printf(", but the lot is full ");
}
}
void carLeaves(struct ParkingLot* p, struct Car* c, int hours, int minutes)
{
struct Time leaveTime;
leaveTime.m_hour = hours;
leaveTime.m_minute = minutes;
struct Time diff;
difference(c->m_enteringTime, leaveTime, &diff);
p->m_currentCount--;
double rate = 0.00;
if (strcmp(c->m_plateNumber, "XYZ 678") == 0)
{
rate = 0;
}
else if (strcmp(c->m_plateNumber, "ABC 123") == 0)
{
rate = p->m_maxCharge;
}
else if (hours > 12 || (diff.m_hour > 3))
{
rate = p->m_maxCharge;
}
else
{
if((diff.m_hour == 1) && (diff.m_minute != 0) && strcmp(c->m_plateNumber,"ADE 901"))
rate = diff.m_hour * p->m_hourlyRate * 2;
else
{
rate = diff.m_hour * p->m_hourlyRate;
}
}
p->revenue += rate;
if (rate == 0)
{
printf(" Car %s leaves Lot %d at %d:%d", c->m_plateNumber, p->m_lotNo, hours, minutes);
}
else if (minutes
{
printf(" Car %s leaves Lot %d at %d:0%d paid $%4.2f. ", c->m_plateNumber, p->m_lotNo, hours, minutes, rate);
}
else
{
printf(" Car %s leaves Lot %d at %d:%d paid $%4.2f. ", c->m_plateNumber, p->m_lotNo, hours, minutes, rate);
}
}
void printLotInfo(struct ParkingLot p)
{
printf("Parkinglot #%d - rate $%4.2f,capacity %d,current cars %d ", p.m_lotNo, p.m_hourlyRate, p.m_capacity, p.m_currentCount);
}
int main() {
struct Car car1, car2, car3, car4, car5, car6, car7, car8, car9;
struct ParkingLot p1, p2;
// Set up 9 cars
initializeCar(&car1, "ABC 123", 0);
initializeCar(&car2, "ABC 124", 0);
initializeCar(&car3, "ABD 314", 0);
initializeCar(&car4, "ADE 901", 0);
initializeCar(&car5, "AFR 304", 0);
initializeCar(&car6, "AGD 888", 0);
initializeCar(&car7, "AAA 111", 0);
initializeCar(&car8, "ABB 001", 0);
initializeCar(&car9, "XYZ 678", 1);
// Set up two parking lots
initializeLot(&p1, 1, 4, 5.5, 20.0);
initializeLot(&p2, 2, 6, 3.0, 12.0);
printLotInfo(p1);
printLotInfo(p2);
printf(" ");
// Simulate cars entering the lots
carEnters(&p1, &car1, 7, 15);
carEnters(&p1, &car2, 7, 25);
carEnters(&p2, &car3, 8, 0);
carEnters(&p2, &car4, 8, 10);
carEnters(&p1, &car5, 8, 15);
carEnters(&p1, &car6, 8, 20);
carEnters(&p1, &car7, 8, 30);
carEnters(&p2, &car7, 8, 32);
carEnters(&p2, &car8, 8, 50);
carEnters(&p2, &car9, 8, 55);
printf(" ");
printLotInfo(p1);
printLotInfo(p2);
printf(" ");
// Simulate cars leaving the lots
carLeaves(&p2, &car4, 9, 0);
carLeaves(&p1, &car2, 9, 5);
carLeaves(&p1, &car6, 10, 0);
carLeaves(&p1, &car1, 10, 30);
carLeaves(&p2, &car8, 13, 0);
carLeaves(&p2, &car9, 15, 15);
carEnters(&p1, &car8, 17, 10);
carLeaves(&p1, &car5, 17, 50);
carLeaves(&p2, &car7, 18, 0);
carLeaves(&p2, &car3, 18, 15);
carLeaves(&p1, &car8, 20, 55);
printf(" ");
printLotInfo(p1);
printLotInfo(p2);
printf(" ");
// Display the total revenue
printf("Total revenue of Lot 1 is $%4.2f ", p1.revenue);
printf("Total revenue of Lot 2 is $%4.2f ", p2.revenue);
}
We will now modify the code so as to allow an arbitrary number of cars and parking lots to be used by using dynamic memory allocation. Copy your parking Simulator.c program to a file called simulator2.c. You will now modify the simulator2.c program as explained here. You must complete this part of the assignment WITHOUT altering any of the structs that you defined earlier and you MUST NOT alter ANY of the functions that you wrote. You will just create two new functions and then alter the main() function Create a function called randomPlate()that takes no parameters and returns a char*. The function should generate a random license plate with the format "xxx # ##" where X is a random character from A to Z and # is a random digit from 0 to 9, The random string must be dynamically-allocated and a pointer to this string should be returned Create a function called randomCar() that takes no parameters and returns a Car*. You MUST make use of the randomPlate) and initializeCar0 functions. The pointer to the new dynamically-allocated Car should be returned Erase the contents of the main() function. Instead, write the main function code so that it follows the directions (in order) as shown below: 1 Make an array to hold pointers to 50 Cars and an armay to hold pointers to 5 ParkingLots 2. 3. 4. Using your randomPlate() and randomCar) functions, set up 50 cars with random plates and random permit status and display them Set up 5 dynamically-allocated parking lots with numbers 1, 2, 3, 4, 5; capacities 5,10, 15,20,25; hourlyRates $4, $5, $6, $7, $8; and max charges $12, $14, $16, $18, $20 Display the lot info for all parking lots Simulate all 50 cars trying to enter a randomly-chosen lot starting at 6am such that each car enters exactly 5 minutes after the previous car entered. Make sure that each car attempts to enter a lot by calling the carEnters) function. Display the lot info again for all parking lots Simulate all parked cars trying to leave the lots (use carLeaves()) starting at 11am such that each car leaves exactly 5 minutes after the previous car left. Make sure that a car has already parked before you try to simulate it leaving. 5. 6. 7. 8. Display the lot info again for all parking lots 9. Display the revenue for all parking lots 10. Free up ALL memory that you had dynamically allocated. Use valgrind to ensure that everything was freed properly .Ensure that each time you run your code, you get different random values Here is an example of the output that you should get: Car JAN 283 with permit Car WS2 290 with permit o Car OND 508 with permit Car COL 466 with permit 1 Car VAD 100 with permit 1 Car XKL 703 with permit Car BLU 699 with permit o Car BTC 135 with permit o Car YEP 717 with permit Car PSJ 117 with permit Car FEY 267 with permit Car PRF 632 with permit Car SUK 690 with permit Car ESJ 347 with permit Car ONK 763 with permit ar ICz 971 with permit Car DLJ 828 with permit Car GvX 452 with permit Car 2YI 547 with permit Car DCH 412 with permit Car XK2 083 with permit Car DEK 392 with permit Car NNP 449 with permit Car YRH 075 with permit Car YV 829 with permit 1 Car DHT 241 with permit Car MLL 990 with permit Car M2M 467 with permit Car mit Car LYA 527 with permit Car SYM 139 with permit Car J20 891 with permit Car ow 927 with permit Car KUK 874 with permit Car YEG 617 with permit Car NRA 866 with permit Car OTZ 167 with permit Car WNJ 227 with permit Car AEO 938 with permit Car MON 025 with permit Car WER 496 with permit Car PJR 480 with permit 1 Car EUW 194 with permit Car IGU 883 with permit Car BWT 903 with permit Car BAZ 646 with permit Car IRX 447 with permit Car KPV 746 with permit Car HYI 380 with permit Car XLR 946 with permit KJB 319 with per Parking Lot 1-rate$4.00, capacity 5, current cars Parking Lot 42 - rate-$5.00, capacity 10, cur rent cars 0 Parking Lot 3-rate $6.00, capacity 15, cur rent cars Parking Lot #4 - rate-57.00, capacity 20, current car s Parking Lot 5 - rate-$8.00, capacity 25, cur rent cars 0 Car JAW 283 enters Lot 4 at 6:00 Car WS2 290 enters Lot 5 at 6:05. Car QND 508 enters Lot 2 at 6:10. Car COL 466 enters Lot 4 at 6:15, Car VAD 100 enters Lot 2 at 6:20 Car XKL 703 enters Lot 5 at 6:25 ar BLU 699 enters Lot 4 at 6:30 Car BTC 135 enters Lot 4 at 6:35 Car YEP 717 enters Lot 2 at 6:40. Car FSJ 117 enters Lot 3 at 6:45 Car FEY 267 enters Lot 2 at 6:50 Car PRF 632 enters Lot 4 at 6:55. Car SUK 690 enters Lot 4 at T:00 Car ESJ 347 enters Lot 2 at 7:05 Car ONK 763 enters Lot 3 at 7:10 Car IC2 971 enters Lot 1 at 7:15 Car DLJ 828 enters Lot 5 at 7:20 Car GVX 452 enters Lot 1 at 7:25 Car 2YI 547 enters Lot 3 at 7:30. Car DCH 412 enters Lot 5 at 7:35 Car XK2 083 enters Lot 2 at 7:40 Car DEK 392 enters Lot 4 at 7:45 Car NNP 449 enters Lot 4 at 7:50 Car YRH 075 enters Lot 3 at 7:55 Car YVY B29 enters Lot 1 at B:00 Car DHT 241 enters Lot 3 at B:05 Car MLL 990 enters Lot 5 at 8:10. Car M2M 467 enters Lot 4 at B:15. Car KJB 319 enters Lot 3 at 8:20 Car LYA 527 enters Lot 2 at 8:25 Car SYM 139 enters Lot 2 at B:30. Car 20 891 enters Lot 1 at 8:35 Car owr 927 enters Lot 2 at 8:40 Car KUK 874 enters Lot 3 at 8:45 Car YEG 617 enters Lot 5 at B:50 Car NRA B66 enters Lot 3 at B:55. Car OT2 167 enters Lot 3 at 9:00. Car WN3 227 enters Lot 3 at 9:05 Car AEO 938 enters Lot 2 at 9:10 Car MON 025 enters Lot 5 at 9:15 Car WER 496 enters Lot 5 at 9:20 Car PJR 480 enters Lot 4 at 9:25 Car EUW 194 enters Lot4 at 9:30 Car IGU 883 enters Lot 3 at 9:35. Car BWT 903 enters Lot 5 at 9:40 Car BAZ 646 enters Lot 1 at 9:45 Car IRX 447 enters Lot 4 at 9:50 Car KFV 746 enters Lot 4 at 9:55 Car HYI 380 arrives at Lot 1 at 10:00, but the lot is full Car HYI 380 cannot get in. Car XLR 946 arrives at Lot 1 at 10:05, but the Lot is full Car XLR 946 cannot get in Parking Lot #1 - rate-$4.00, capacity 5, current cars 5 Parking Lot #2 - rate-$5.00, capacity 10, cur rent cars ID Parking Lot #4 - rate " $7.00, capacity 20, cur rent cars 13 Parking Lot #5 -rate-$8.00, capacity 25, cur rent cars 9 Car JAN 283 leaves Lot 4 at 11:00 paid $16.00 Car WSZ 290 Leaves Lot 5 at 11:05 paid $18.00 Car OND 508 Leaves Lot 2 at 11:10 Car COL 466 1eaves Lot 4 at 11:15 Car VAD 100 1eaves Lot 2 at 11:20. Car XKL 703 Leaves Lot 5 at 11:25 paid $18.00 Car BLU 699 leaves Lot 4 at 11 :30 paid $16.00 Car BTC 135 leaves Lot 4 at 11:35 paid $16.00 Car YEP 717 1eaves Lot 2 at11:40 Car FSJ 117 Leaves Lot 3 at 11:45 Car FEY 267 leaves Lot 2 at 11:50 Car PRP 632 leaves Lot 4 at 11:55. Car SUK 690 1eaves Lot 4 at 12:00 Car ESJ 347 Leaves Lot 2 at 12:05 paid $12. 00 Car ONK 763 Leaves Lot 3 at 12:10 ar ICz 971 Leaves Lot 1 at 12:15 paid $10.00 Car DLJ 828 1eaves Lot 5 at 12 :20 Car GVX 452 l eaves Lot 1 at 12:25 paid $10.00 Car 2YI 547 1eaves Lot 3 at 12:30 Car DCH 412 Leaves Lot 5 at 12:35 paid $18.00 ar XK2 083 leaves Lot 2 at 12:40 pa id $12.00 Car DEK 392 1eaves Lot 4 at 12:45 Car NNP 449 leaves Lot 4 at 12:50 Car YRH 075 leaves Lot 3 at 12:55 paid $14.00 Car YVY 829 leaves Lot1 at 13:00 Car DHT 241 1eaves Lot 3 at 13:05 Car MLL 990 Leaves Lot 5 at 13:10 Car M2M 467 Leaves Lot 4 at 13:15 paid$16.00 Car KJB 319 Leaves Lot 3 at 13:20 paid $14.00 Car LYA 527 Leaves Lot 2 at 13:25 paid $12.00 Car SYM 139 Leaves Lot 2 at 13:30 Car 2Q 891 leaves Lot 1 at 13:35 paid $10.00. Car OWT 927 Leaves Lot 2 at 13:40 paid $12.00 Car YEG 617 Leaves Lot 5 at 13:50 paid $18.00 Car NRA 866 Leaves Lot 3 at 13:55 Car OTZ 167 Leaves Lot 3 at 14:00 Car WNJ 227 leaves Lot 3 at 14:05 paid $14.00 Car AEO 938 Leaves Lot 2 at 14:10 paid $12.00 Car MON 025 leaves Lot 5 at 14:15 Car WER 496 1eaves Lot 5 at 14:20. Car PJR 480 leaves Lot 4 at 14:25. Car EUW 194 Leaves Lot 4 at 14:30 Car IGU 883 Leaves Lot 3 at 14:35 paid $14.00 Car BWT 903 Leaves Lot 5 at 14:40 Car BAZ 646 Leaves Lot 1 at 14:45 paid $10.00 Car IRX 447 Leaves Lot 4 at 14:50 paid $16.00 Car KPV 746 Leaves Lot 4 at 14:55 Parking Lot #1 - rate-$4.00, capacity 5, current cars Parking Lot #2-rate-$5.00, capacity 10, cur rent cars Parking Lot 3-rate $6.00 capacity 15, current cars Parking Lot #4 - rate-$7.00, capacity 20, cur rent cars Parking Lot #5-rate-$8.00, capacity 25, cur rent cars otal revenue of Lot 1 is $40.00 Total revenue of Lot 2 is $60.00 Total revenue of Lot 3 is $70.00 Total revenue of Lot 4 is $80.00 Total revenue of Lot 5 is $72.00 We will now modify the code so as to allow an arbitrary number of cars and parking lots to be used by using dynamic memory allocation. Copy your parking Simulator.c program to a file called simulator2.c. You will now modify the simulator2.c program as explained here. You must complete this part of the assignment WITHOUT altering any of the structs that you defined earlier and you MUST NOT alter ANY of the functions that you wrote. You will just create two new functions and then alter the main() function Create a function called randomPlate()that takes no parameters and returns a char*. The function should generate a random license plate with the format "xxx # ##" where X is a random character from A to Z and # is a random digit from 0 to 9, The random string must be dynamically-allocated and a pointer to this string should be returned Create a function called randomCar() that takes no parameters and returns a Car*. You MUST make use of the randomPlate) and initializeCar0 functions. The pointer to the new dynamically-allocated Car should be returned Erase the contents of the main() function. Instead, write the main function code so that it follows the directions (in order) as shown below: 1 Make an array to hold pointers to 50 Cars and an armay to hold pointers to 5 ParkingLots 2. 3. 4. Using your randomPlate() and randomCar) functions, set up 50 cars with random plates and random permit status and display them Set up 5 dynamically-allocated parking lots with numbers 1, 2, 3, 4, 5; capacities 5,10, 15,20,25; hourlyRates $4, $5, $6, $7, $8; and max charges $12, $14, $16, $18, $20 Display the lot info for all parking lots Simulate all 50 cars trying to enter a randomly-chosen lot starting at 6am such that each car enters exactly 5 minutes after the previous car entered. Make sure that each car attempts to enter a lot by calling the carEnters) function. Display the lot info again for all parking lots Simulate all parked cars trying to leave the lots (use carLeaves()) starting at 11am such that each car leaves exactly 5 minutes after the previous car left. Make sure that a car has already parked before you try to simulate it leaving. 5. 6. 7. 8. Display the lot info again for all parking lots 9. Display the revenue for all parking lots 10. Free up ALL memory that you had dynamically allocated. Use valgrind to ensure that everything was freed properly .Ensure that each time you run your code, you get different random values Here is an example of the output that you should get: Car JAN 283 with permit Car WS2 290 with permit o Car OND 508 with permit Car COL 466 with permit 1 Car VAD 100 with permit 1 Car XKL 703 with permit Car BLU 699 with permit o Car BTC 135 with permit o Car YEP 717 with permit Car PSJ 117 with permit Car FEY 267 with permit Car PRF 632 with permit Car SUK 690 with permit Car ESJ 347 with permit Car ONK 763 with permit ar ICz 971 with permit Car DLJ 828 with permit Car GvX 452 with permit Car 2YI 547 with permit Car DCH 412 with permit Car XK2 083 with permit Car DEK 392 with permit Car NNP 449 with permit Car YRH 075 with permit Car YV 829 with permit 1 Car DHT 241 with permit Car MLL 990 with permit Car M2M 467 with permit Car mit Car LYA 527 with permit Car SYM 139 with permit Car J20 891 with permit Car ow 927 with permit Car KUK 874 with permit Car YEG 617 with permit Car NRA 866 with permit Car OTZ 167 with permit Car WNJ 227 with permit Car AEO 938 with permit Car MON 025 with permit Car WER 496 with permit Car PJR 480 with permit 1 Car EUW 194 with permit Car IGU 883 with permit Car BWT 903 with permit Car BAZ 646 with permit Car IRX 447 with permit Car KPV 746 with permit Car HYI 380 with permit Car XLR 946 with permit KJB 319 with per Parking Lot 1-rate$4.00, capacity 5, current cars Parking Lot 42 - rate-$5.00, capacity 10, cur rent cars 0 Parking Lot 3-rate $6.00, capacity 15, cur rent cars Parking Lot #4 - rate-57.00, capacity 20, current car s Parking Lot 5 - rate-$8.00, capacity 25, cur rent cars 0 Car JAW 283 enters Lot 4 at 6:00 Car WS2 290 enters Lot 5 at 6:05. Car QND 508 enters Lot 2 at 6:10. Car COL 466 enters Lot 4 at 6:15, Car VAD 100 enters Lot 2 at 6:20 Car XKL 703 enters Lot 5 at 6:25 ar BLU 699 enters Lot 4 at 6:30 Car BTC 135 enters Lot 4 at 6:35 Car YEP 717 enters Lot 2 at 6:40. Car FSJ 117 enters Lot 3 at 6:45 Car FEY 267 enters Lot 2 at 6:50 Car PRF 632 enters Lot 4 at 6:55. Car SUK 690 enters Lot 4 at T:00 Car ESJ 347 enters Lot 2 at 7:05 Car ONK 763 enters Lot 3 at 7:10 Car IC2 971 enters Lot 1 at 7:15 Car DLJ 828 enters Lot 5 at 7:20 Car GVX 452 enters Lot 1 at 7:25 Car 2YI 547 enters Lot 3 at 7:30. Car DCH 412 enters Lot 5 at 7:35 Car XK2 083 enters Lot 2 at 7:40 Car DEK 392 enters Lot 4 at 7:45 Car NNP 449 enters Lot 4 at 7:50 Car YRH 075 enters Lot 3 at 7:55 Car YVY B29 enters Lot 1 at B:00 Car DHT 241 enters Lot 3 at B:05 Car MLL 990 enters Lot 5 at 8:10. Car M2M 467 enters Lot 4 at B:15. Car KJB 319 enters Lot 3 at 8:20 Car LYA 527 enters Lot 2 at 8:25 Car SYM 139 enters Lot 2 at B:30. Car 20 891 enters Lot 1 at 8:35 Car owr 927 enters Lot 2 at 8:40 Car KUK 874 enters Lot 3 at 8:45 Car YEG 617 enters Lot 5 at B:50 Car NRA B66 enters Lot 3 at B:55. Car OT2 167 enters Lot 3 at 9:00. Car WN3 227 enters Lot 3 at 9:05 Car AEO 938 enters Lot 2 at 9:10 Car MON 025 enters Lot 5 at 9:15 Car WER 496 enters Lot 5 at 9:20 Car PJR 480 enters Lot 4 at 9:25 Car EUW 194 enters Lot4 at 9:30 Car IGU 883 enters Lot 3 at 9:35. Car BWT 903 enters Lot 5 at 9:40 Car BAZ 646 enters Lot 1 at 9:45 Car IRX 447 enters Lot 4 at 9:50 Car KFV 746 enters Lot 4 at 9:55 Car HYI 380 arrives at Lot 1 at 10:00, but the lot is full Car HYI 380 cannot get in. Car XLR 946 arrives at Lot 1 at 10:05, but the Lot is full Car XLR 946 cannot get in Parking Lot #1 - rate-$4.00, capacity 5, current cars 5 Parking Lot #2 - rate-$5.00, capacity 10, cur rent cars ID Parking Lot #4 - rate " $7.00, capacity 20, cur rent cars 13 Parking Lot #5 -rate-$8.00, capacity 25, cur rent cars 9 Car JAN 283 leaves Lot 4 at 11:00 paid $16.00 Car WSZ 290 Leaves Lot 5 at 11:05 paid $18.00 Car OND 508 Leaves Lot 2 at 11:10 Car COL 466 1eaves Lot 4 at 11:15 Car VAD 100 1eaves Lot 2 at 11:20. Car XKL 703 Leaves Lot 5 at 11:25 paid $18.00 Car BLU 699 leaves Lot 4 at 11 :30 paid $16.00 Car BTC 135 leaves Lot 4 at 11:35 paid $16.00 Car YEP 717 1eaves Lot 2 at11:40 Car FSJ 117 Leaves Lot 3 at 11:45 Car FEY 267 leaves Lot 2 at 11:50 Car PRP 632 leaves Lot 4 at 11:55. Car SUK 690 1eaves Lot 4 at 12:00 Car ESJ 347 Leaves Lot 2 at 12:05 paid $12. 00 Car ONK 763 Leaves Lot 3 at 12:10 ar ICz 971 Leaves Lot 1 at 12:15 paid $10.00 Car DLJ 828 1eaves Lot 5 at 12 :20 Car GVX 452 l eaves Lot 1 at 12:25 paid $10.00 Car 2YI 547 1eaves Lot 3 at 12:30 Car DCH 412 Leaves Lot 5 at 12:35 paid $18.00 ar XK2 083 leaves Lot 2 at 12:40 pa id $12.00 Car DEK 392 1eaves Lot 4 at 12:45 Car NNP 449 leaves Lot 4 at 12:50 Car YRH 075 leaves Lot 3 at 12:55 paid $14.00 Car YVY 829 leaves Lot1 at 13:00 Car DHT 241 1eaves Lot 3 at 13:05 Car MLL 990 Leaves Lot 5 at 13:10 Car M2M 467 Leaves Lot 4 at 13:15 paid$16.00 Car KJB 319 Leaves Lot 3 at 13:20 paid $14.00 Car LYA 527 Leaves Lot 2 at 13:25 paid $12.00 Car SYM 139 Leaves Lot 2 at 13:30 Car 2Q 891 leaves Lot 1 at 13:35 paid $10.00. Car OWT 927 Leaves Lot 2 at 13:40 paid $12.00 Car YEG 617 Leaves Lot 5 at 13:50 paid $18.00 Car NRA 866 Leaves Lot 3 at 13:55 Car OTZ 167 Leaves Lot 3 at 14:00 Car WNJ 227 leaves Lot 3 at 14:05 paid $14.00 Car AEO 938 Leaves Lot 2 at 14:10 paid $12.00 Car MON 025 leaves Lot 5 at 14:15 Car WER 496 1eaves Lot 5 at 14:20. Car PJR 480 leaves Lot 4 at 14:25. Car EUW 194 Leaves Lot 4 at 14:30 Car IGU 883 Leaves Lot 3 at 14:35 paid $14.00 Car BWT 903 Leaves Lot 5 at 14:40 Car BAZ 646 Leaves Lot 1 at 14:45 paid $10.00 Car IRX 447 Leaves Lot 4 at 14:50 paid $16.00 Car KPV 746 Leaves Lot 4 at 14:55 Parking Lot #1 - rate-$4.00, capacity 5, current cars Parking Lot #2-rate-$5.00, capacity 10, cur rent cars Parking Lot 3-rate $6.00 capacity 15, current cars Parking Lot #4 - rate-$7.00, capacity 20, cur rent cars Parking Lot #5-rate-$8.00, capacity 25, cur rent cars otal revenue of Lot 1 is $40.00 Total revenue of Lot 2 is $60.00 Total revenue of Lot 3 is $70.00 Total revenue of Lot 4 is $80.00 Total revenue of Lot 5 is $72.00
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started