Question: (25 points) (The speed limit is a constant) Write a program that computes the price of the speeding ticket for a given car speed limit
(25 points) (The speed limit is a constant) Write a program that computes the price of the speeding ticket for a given car 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. CH- 2. . The speed 8 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. . If the car speed is more than 55 mph over the speed limit than the driver should be arrested. 7 Please insert the speed between and 158 Mph: 19e The ticket cost is: 275 Program ended with exit code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
