The Dutch government wants to track where every car in the Netherlands is by equipping each carwith a short-range transmitter. When a car passes detectors that have been installed in the roadsurface, the transmitter sends the license plate number (kenteken) to these detectors. All detectorsare connected to a central computer, that stores these license plate numbers in a file, as well as theid of t
...[Show More]
The Dutch government wants to track where every car in the Netherlands is by equipping each car
with a short-range transmitter. When a car passes detectors that have been installed in the road
surface, the transmitter sends the license plate number (kenteken) to these detectors. All detectors
are connected to a central computer, that stores these license plate numbers in a file, as well as the
id of the detector that received the license plate number, and the time at which the license plate
number was received.
This system can be used to detect which cars are going over the speed limit. To do so, a file with
the following structure is used:
•The first line contains the maximum speed (in km/h) for the road that the detectors are placed
on.
•All other lines start with the number of the detector that was passed (1 or 2), followed by the
time on which the car passed the detector, and then followed by the license plate number of
that car.
Example input (an actual input file can be found on Canvas):
50
1 09:00:00 OZ-15-ZU
2 09:00:04 WS-LP-74
1 09:00:07 97-YC-51
1 09:00:10 NV-71-PU
2 09:00:21 OZ-15-ZU
[...]
2 09:04:58 CN-70-OT
You can assume that the detectors are on a one-way road, and the distance between the two detectors
is 200 meters. The program should be able to do the following:
•Print a list of the license plate numbers of all cars that went over the speed limit, as well as
the average speed of each of those cars.
•Print the license plate numbers of all cars that are still between the two sensors.
Note: It is possible that there are cars in between the two sensors at the moment that the mea-
surement starts. These cars will only pass the second detector during the measurement. You don't
have to check if these cars go over the speed limit
[Show Less]