Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that computes the price of the speeding ticket for a given car speed. The speed limit on the highway is 55 mph.

Write a program that computes the price of the speeding ticket for a given car speed. The
speed limit on the highway is 55 mph. The program should allow user to input the car speed
only between 0 and 150 mph. If the user inputs incorrect car speed the program should
terminate without computing the value of the speeding ticket.
image text in transcribed
2. (25 points) (The speed limit is a constant) Write a program that computes the price of the speeding ticket for a given car speed. The speed limit on the highway is 55 mph. The program should allow user to input the car speed only between O and 150 mph. If the user inputs incorrect car speed the program should terminate without computing the value of the speeding ticket. Speeding ticket computation rules: No speeding ticket if car speed is less than or equal to 55 mph If the car speed is not more than 20 mph over the speed limit than the ticket price is $50 plus $2 for each additional mile over speed limit. If the car speed is more than 20 mph over the speed limit but not more than 55 mph over the speed limit than the ticket price is $50 plus $5 for each additional mile over speed limit. olf the car speed is more than 55 mph over the speed limit than the driver should be arrested. Please insert the speed between and 150 Mph: 18e The ticket cost is: 275 Program ended with exit code: e

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

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions

Question

What is a credit limit? How can you increase your credit limit?

Answered: 1 week ago

Question

=+Are you interested in working on global teams?

Answered: 1 week ago

Question

=+Do you want to work from home?

Answered: 1 week ago

Question

=+ What skills and competencies will enable someone

Answered: 1 week ago