Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that is given two integers representing a speed limit and driving speed in miles per hour ( mph ) and outputs the

Write a program that is given two integers representing a speed limit and driving speed in miles per hour (mph) and outputs the traffic ticket amount.
Driving 10 mph under the speed limit (or slower) receives a $50 ticket. Driving 6-20 mph over the speed limit receives a $75 ticket. Driving 21-40 mph over the speed limit receives a $150 ticket. Driving faster than 40 mph over the speed limit receives a $300 ticket. Otherwise, no ticket is received.
Ex: If the input is:
3545
the output is:
75
Ex: If the input is:
3526
the output is:
0
image text in transcribed

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 Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions

Question

Explain the dual challenges of adverse selection and moral hazard.

Answered: 1 week ago

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago