Task 5 was revealed 4.4.2025 at 18:00 CET
Login required
Available from 04.04.2025 18:00 CET until 05.04.2025 17:59 CET - You can get 5 points
The Flawed Autobahn Speed Tests
Problem Statement:
A country famous for its high-speed highways has introduced automated speed monitoring systems. Before deployment, developers wrote unit tests to verify the system’s correctness. However, some test cases contain logical errors, leading to false positives or false negatives. Your task is to analyze and identify faulty unit tests where the system's violation flag is incorrect based on the given speed rules.
Input:
You receive a list of unit tests in the following format:
TEST_ID;CAR_SPEED (km/h);ROAD_TYPE;WEATHER;VIOLATION
- TEST_ID: Unique identifier for the test case
- CAR_SPEED: The recorded speed of the vehicle
- ROAD_TYPE: Either HIGHWAY, CITY, or RURAL
- WEATHER: Either CLEAR, RAIN, or FOG
- VIOLATION: TRUE if the system flags a violation, FALSE otherwise
The speed rules are:
- CITY: 50 km/h (40 km/h in rain, 30 km/h in fog)
- RURAL: 100 km/h (80 km/h in rain, 60 km/h in fog)
- HIGHWAY: No limit in clear conditions, but 130 km/h in rain, 100 km/h in fog
Output:
Your program should detect the IDs of the faulty unit tests where the VIOLATION flag does not correctly reflect whether a speeding violation occurred according to the speed rules.
Example Input:
T001;55;CITY;CLEAR;FALSE
T002;120;HIGHWAY;RAIN;FALSE
T003;90;RURAL;FOG;TRUE
T004;130;HIGHWAY;FOG;TRUE
T005;50;CITY;RAIN;TRUE
Example Output:
T001
T005
Click here to download CGW Task 5 Input file
Answ er :
T4
T11
T64
T66
T68
T69
T71
T94
T118
T135
T136
T149
T152
T158
T184
T189
T191
T222
T237
T240
Germany
All participants received the point for the country