[SOLVED] C++ program that reads the travelled distance of a car in km (as integer) and the elapsed time in minutes

20.00 $

Programming resource
, Digital learning resource
Categories: ,
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (3 votes)

A local Road Safety Department is tasked with monitoring and issuing speeding tickets and warnings for drivers who violate the 120 km/hr speed limits. 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 and government owned ones

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)

Compute the speed as the travelled distance divided by the time in hours.

Check if the driver violated the speed limit Of 120 km,’hr and issue speed violation

ticket/notices/action according to the following table:

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.