Solve it using files and functions Transcribed Image Text: A local Road Safety Department is tasked with monitoring and issuing speeding tickets for
drivers who violate the 120 km/hr speed limit. Write a complete C++ program that reads the
plate number of a car (string), travelled distance of in km (as integer) and the elapsed time in
minutes (as integer) from a file called “driving.txt”. The program should compute the speed
(km/hr) of the car and issue violation ticket if the driver exceeds the speed limit. The program
must distinguish between private small vehicles (‘S’) and large commercial trucks (‘T’).
Your program should implement the following functions:
Speed: Function that gets the distance (km) and the time (minutes) as input and returns the speed
of the car in km/hr
Tickets: Void function that determine the speeding tickets of each car as per Table 1. The
function takes plate number of the car and the car speed as input and prints out the tickets value
and any warnings for the driver.
Table 1: Speed tickets and warning classes
Speed Violation fee
Between 120 and 140 km/hour
Between 140 and 160 km/hour
More than 160km/hour
50 OMR and
100 OMR and
driver’s license is suspended
driver’s license is
Less than or equal 120 km/hour
Input: The input file “driving.txt” consists of several test cases. Each test case consists of plate
number(string), car type (char), distance in km (positive integer, >=0) and time in minuets (integer, >0 ).
Note: Your program should only process correct input data.
Output: For each test case, print one line containing the plate number, speed violation and warning (if
any). The last line of the output contains the total number of issued speed violations.
Sample Input file and output screen:
Speed Type Tickets
27652K 133.333 T
Total suspensions : 2
Press any key to continue