Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A local Road Safety Department is tasked with monitoring and issuing speeding tickets and warnings for drivers who violate the 120 km/hr speed limit. Write

image text in transcribed
A local Road Safety Department is tasked with monitoring and issuing speeding tickets and warnings for drivers who violate the 120 km/hr speed limit. Write a complete C+ program that reads the travelled distance of a car in km (as integer) and the elapsed time in minutes (as integer). The program should compute the speed of the car and issue violation ticket if the driver exceeds the speed limit. The program must distinguish between private small vehicles ('S'), large commercial trucks (T'), and government owned ones ('G'). Your program should perform the following tasks Prompt the user to enter the type of the car (S, T, or G) Prompt the user to enter the travelled distance Prompt the user to enter the elapsed time Convert the time from minutes to hours. (e.g. 90 minutes = 1.5 hours) o o o o Compute the speed as the travelled distance divided by the time in hours. o Check if the driver violated the speed limit of 120 km/hr and issue speed violation ticketotices/action according to the following table d Violation fee Between 120 and 140 km/hour Between 140 and 160 km/hour More than 160 km/hour 10 OMR 30 OMR 50 OMR, and 20 OMR 60 OMR Notify the government 100 OMR, and nstitution of the driver's licence is driver's licence is violation sus suspended Less than or equal to 120 0 OMR (No violation)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

(a)What is groundwater? (b)What is an aquifer?

Answered: 1 week ago

Question

In which ways would you measure training success? Explain.

Answered: 1 week ago

Question

Evaluate Meyers and Browns approach to career development.

Answered: 1 week ago