=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...


A local Road Safety Department is tasked with monitoring and issuing speeding tickets for<br>drivers who violate the 120 km/hr speed limit. Write a complete C++ program that reads the<br>plate number of a car (string), travelled distance of in km (as integer) and the elapsed time<br>minutes (as integer) from a file called “driving.txt=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: driving.txt X C. C:\Windows\system32\cmd.exe 123A S 120 40 PNO Speed Type Tickets 27652K T 200 90 123A 27652K 180 50 suspended 133.333 T 20 3653S T 145 8725D 240 50 suspended 8725D 60 15 7625S 100 T Total suspensions : 2 Press any key to continue 7252F S -80 15 7625S 100 60 "/>
Extracted 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 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 S Speed Between 120 and 140 km/hour 10 OMR 20 OMR Between 140 and 160 km/hour 30 OMR 60 OMR 50 OMR and 100 OMR and driver's license is More than 16Okm/hour driver's license is suspended suspended 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: driving.txt X C. C:\Windows\system32\cmd.exe 123A S 120 40 PNO Speed Type Tickets 27652K T 200 90 123A 27652K 180 50 suspended 133.333 T 20 3653S T 145 8725D 240 50 suspended 8725D 60 15 7625S 100 T Total suspensions : 2 Press any key to continue 7252F S -80 15 7625S 100 60
Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here