You must design and implement a system to track vehicles entering and exiting a car park, calculating parking charges if required, storing the details to file and allowing functionality to produce a report for a given date with a list of number plates, enter/exit times and parking price.You should consider carefully which data structure to use for the various parts of the system.
During the design phase, you should analyse the algorithms for adding a vehicle as it enters the car park and, removing the vehicle from the collection of current vehicles, calculating the parking charge and adding it to the history when it exits. You should not use any third party libraries or code as a part of your solution and all code should be written by you, i.e. not automatically generated.
You also shouldn’t use non-standard or operating system dependant libraries in your program or operating system calls (the code should all be standard C++). To achieve a good mark, you should design and implement the data structures yourself. Using standard template library (STL) data structures will severely limit the grade you can achieve. Apply the knowledge you have gained on this module to select and design the data structures and algorithms which are most appropriate and to analysis the time-complexity for your report.
A large car park requires an automated system which tracks vehicles as they enter and exit the car park using their number plate and calculates the parking cost as they exit. The input to your program will be from a file which will have (on each line) a time and date and either a vehicle entering or exiting the car park. Your program must use an appropriate data structure to track the vehicles currently in the car park. When they leave they should be removed from this data structure and added to a history data structure which stores all vehicles, entry and exit times and parking charge.
You will be provided with a small sample data file in the correct format to use when writing and testing your program. However, the program should work with any file of this format (and another file will be used when marking your work); therefore, your program should allow the user to specify the input file name as a command line argument. Parking prices will be calculated using the following table.
It is recommended that you complete the tasks in the following order as the later sub-tasks will require the earlier ones.
4.1 Set up Project
Create a Git repository and makefile for the project, remember to update the makefile and commit new files to the git repository as you implement/update them.
4.2 Plan Software
Design and implement a class to store the necessary details of a vehicle with a specific number plate.
4.3 Design and Implement Data Structure/Algorithm
Design and implement the data structure(s) which will store the Vehicle objects and associated algorithm(s) to add and remove them as they enter and exit the car park. Analyse the timecomplexity of the algorithms (this will be needed in your report). You must also justify your selection of data structure, based on the requirements of the program.
4.4 Test Data Structure
Apply software testing (using catch2) to ensure your vehicle class, data structures and algorithms are all working correctly.
4.5 Read Sample Data File
Implement the program to read the sample data from the given file and process it using the data structures.
4.6 Implement Menu
Implement a (command line) user interface to allow users to output all vehicles with entry and exit times and parking cost for a specific date.The output should be sorted by entry times.
4.7 Write Report
Finish writing the report, including the time-complexity analysis and test cases you prepared while designing the software.