Write a program that does 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.
Write a program that does 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.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
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 :
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. Write a program that does 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.
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 :
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. Write a program that does 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.
Example output:
The following cars went over the speed limit:
GH-23-NN - 68 km/h
NV-71-PU - 56 km/h
CN-70-OT - 70 km/h
18-IP-VU - 59 km/h
The following cars are currently between the two sensors:
45-HH-97
OF-UZ-13
The following cars went over the speed limit:
GH-23-NN - 68 km/h
NV-71-PU - 56 km/h
CN-70-OT - 70 km/h
18-IP-VU - 59 km/h
The following cars are currently between the two sensors:
45-HH-97
OF-UZ-13
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY