In: Computer Science
DESIGH A FLOWCHART IN FLOWGORITHM
Speeding Violation Calculator. Design a program that calculates and displays the number of miles per hour over the speed limit that a speeding driver was doing. The program should ask for the speed limit and the driver's speed.
Validate the input as follows:
The speed limit should be at least 20, but not greater than 70.
The driver's speed should be at least the value entered for the speed limit (otherwise the driver was not speeding) Once correct data has been entered, the program should calculate and display the number of miles per hour over the speed limit that the driver was doing.
PLEASE AND THANK YOU
If you need any corrections kindly comment.
Please give a Thumps Up if you like the answer.
Flowgorithm
Output
Enter speed limit :
15
ERROR: the speed must be between 20 and 70 .
Enter speed limit :
75
ERROR: the speed must be between 20 and 70 .
Enter speed limit :
65
Enter speed :
60
Yow were going 5 MPH over the speed limit
Psuedocode
Function Main
Declare Integer speedLimit, speed, lowSpeed,
highSpeed, overSpeed
Assign lowSpeed = 20
Assign highSpeed = 70
Output "Enter speed limit : "
Input speedLimit
While speedLimit<lowSpeed or
speedLimit>highSpeed
Output "ERROR: the speed
must be between " &lowSpeed& " and " &highSpeed& "
."
Output "Enter speed
limit : "
Input speedLimit
End
Output "Enter speed : "
Input speed
Assign overSpeed = speedLimit-speed
Output "Yow were going " &overSpeed& "
MPH over the speed limit"
End