Question

Speeding Violation Calculator: Design a program that calculates and displays the number of miles per hour...

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.

#Program specification: program should be modular.

#need pseudocode and flowgorithm flowchart

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Module main()

//Variables to hold speed limit and driver?s speed.
Declare Real speedLimit, driverSpeed

//Variable to store no. of miles/hour over speed limit.
Declare Real overSpeedValue

//Get speed limit from user.
Display ?Enter the speed limit.?
Input speedLimit

//Validate speed limit.
While speedLimit < 20="" or="" speedlimit=""> 70
   Display ?ERROR: Speed limit cannot be less than 20?
   Display ?or greater than 70.?
   Display ?Enter valid value for speed limit, in the?
   Display ?range of 20 to 70...

Start Enter speed) Enter speed While speed 710 enter valid speed While Speed <20 Error k Yes NO Your in speed end

Add a comment
Know the answer?
Add Answer to:
Speeding Violation Calculator: Design a program that calculates and displays the number of miles per hour...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Chapter 7 exercise 4, python code for Speeding violation Cal

    Exercise 4 – Chapter 7 Speeding violation CalculatorPython code for the followingDesign 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 speedlimit 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...

  • Python "Speeding Violation Calculator" Program

    Please create this program in Python and run it making sure it works... Thank you SO much in advance. :)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 speedlimit 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...

  • How to write a program in python for "speed violation calculator" with a while loop and...

    How to write a program in python for "speed violation calculator" with a while loop and if statements. calculate the number of miles over the speed limit and display it. ask for the speed limit and the drivers speed the speed limit should be at least 20 but not greater than 70 if the driver's speed is less then the speed limit the driver was not speeding program should calculator and display the number of mph over the speed limit...

  • Speeding Fine Calculator You have been hired by the police department of the city you live...

    Speeding Fine Calculator You have been hired by the police department of the city you live in to create a program to calculate the fine that a motorist could pay. If the motorist was travelling at or below the speed limit, there is no fine. If the motorist is travelling over the speed limit, the amount of the fine is determined based on the table below. The speed limit that will be entered is a multiple of 5 from 5...

  • Under Galilean relativity, if a police officer is driving at 50 miles per hour on a...

    Under Galilean relativity, if a police officer is driving at 50 miles per hour on a highway with a speed limit of 70 miles per hour, what speed must she observe from a driver going in the opposite direction in order to know the person must be speeding?

  • I need trying to figure out how I can make create a code in Python with this exercise for I am having trouble doing so. Miles Per Gallon Calculator Write a GUI program that calculates a car's gas...

    I need trying to figure out how I can make create a code in Python with this exercise for I am having trouble doing so. Miles Per Gallon Calculator Write a GUI program that calculates a car's gas mileage. The program's window should have Entry widgets that let the user enter the number of gallons of gas the car holds, and the number of miles it can be driven on a full tank. When a Calculate MPG button is clicked,...

  • Draw the hierarchy chart and design the logic for a program that calculates the projected cost...

    Draw the hierarchy chart and design the logic for a program that calculates the projected cost of a remodeling project. Assume that the labor cost is $30 per hour. Design a program that prompts the user for a number hours projected for the job and the wholesale cost of materials. The program computes and displays the cost of the job which is the number of hours times the hourly rate plus the 120% of the wholesale cost of materials. The...

  • Its an app) (Miles-per-Gallon Calculator App) In java with comments Place AnchorPane in design and set...

    Its an app) (Miles-per-Gallon Calculator App) In java with comments Place AnchorPane in design and set its attributes Place mileTextField, gallonsTextField and calcButton on the AnchorPane and set their attributes Place label that will show the calculated value and set its attributes Drivers often want to know the miles per gallon their cars get so they can estimate gasoline costs. Develop an app that allows the user to input the number of miles driven and the number of gallons used...

  • Lab 8 python code for Cell Phone Bill

    Lab 8: Cell Phone Bill CalculatorWrite the Python code for the following programming problem definition.Use modular design according to the modules specified below.Design and write a program that calculates and displays the number of minutes over the monthly contract minutes that a cell phone user incurred. The program should askthe user how many minutes were used during the month and how many minutes they were allowed. Validate the input as follows:• The minimum minutes allowed should be at least 100,...

  • Write a program that calculates the calories burned while running over a given number of miles....

    Write a program that calculates the calories burned while running over a given number of miles. While several factors determine how many calories are burned during a mile run, for this program, 90 calories are burned for every mile of running. The cumulative calories burned during a run can be calculated as: Calories * Distance For example, if a person runs 5 miles, the total calories burned is 450. After 3 hours, the person has burned 2 calories. The program...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT