Question: 20.3 ParkingLot Lab - 3 ParkingLot Lab - 3 Objective: The objective of this Lab is to write a ParkingLot class and a program to

20.3 ParkingLot Lab - 3
ParkingLot Lab - 3
Objective:
The objective of this Lab is to write a ParkingLot class and a program to simulate the running of 3 parking lots at an airport.
Task 1: Create a program with the following specification:
-
Create a program which contains a ParkingLot class, and stores information about a parking lot: name, vector of car names, daily rate, capacity.
-
Your full program will help an airport run 3 parking lots: Economy, Standard, and Premium. When run, it should present a menu to allow a car to enter each of the 3 lots, exit each of the 3 lots, give stats on the 3 lots, or quit. Assume that the number of available spots in each lot is 10 and that the daily rate charged by each lot is $5, $10, and $20 for Economy, Standard, and Premium respectively.
-
To support your program, your ParkingLot class should have the following traits:
- Store 4 private variables: name, capacity, daily rate, and a vector of the cars currently in the lot. Since these are private, the exact variable names do not matter.
- A setter and getter for each of the 4 variables listed above:
- getLotName() , setLotName()
- getAvailableSpots() , getTakenSpots()
- getRate() , setRate() , setCapacity()
- addCar() , removeCarByName() link*. Note that the removeCarByName() function will most likely require the use of vectors rather than arrays :)
- Implement a getProfit() function which returns how much profit will be made with the current rate and occupancy for a day
- Implement a printStats() function to print out the statistics for the lot, including the occupancy rate.
- When compiled with g++ -Wall parking.cpp, no warnings are given.
Task 2: Properly style your code, clean up all warnings.
Be sure to put a header at the top of your code, including your name, date, and short description of the program. If coding in Cloud9, adding a -Wall on the compilation line (e.g. gpp -Wall parking.cpp) will print out all compiler suggested issues and count them as errors--I recommend doing this because Zybooks will do this too. These are not errors, but suspect issues. Fix your code to remove all warnings. Make sure no warnings are given when compiling with -Wall.
c++
main.cpp Load default template... 1 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
