This accepts a welformed CSV card tap on file using the command line arguments and calaculate the trip details.
Asumptions
- The input CSV file is well-formed and contains all the required data fields (ID, DateTimeUTC, TapType, StopId, CompanyId, BusID, PAN).
- The input file only contains valid data, and there are no missing or incorrect values.
V3:
- Test cases added
- Input and output files added
V2: What does it handles
- Tap records starting with OFF events
- Tap records with out of order events
- Incomplete and cancelled trips
V1: Wht does it handles (depreceiated)
- Only records starting with an ON reord
- Only records that are in order.
How to run this code:
- Create or drop the tap file with the correct format to a file location
- Copy the file location
- Compile the LittlePayTripProcessor class (javac LittlePayTripProcessor)
- Run the application with the file location copied from step 2 as an argument.
- LittlepayTrupProcessor /path/to/your/input/file.csv
- Output file be created in the root directory called : LittlePayTrips.csv