Question: (1) IF THEN structure Illinois's basic speeding law prohibits driving at a speed that is greater than is reasonable and proper with regard to traffic
(1) IF THEN structure Illinois's basic speeding law prohibits driving at a speed that is "greater than is reasonable and proper with regard to traffic conditions and the use of the highway, or endangers the safety o any person or property." In other words, motorists must always drive at a safe speed. What a safe speed is will depend on the circumstances (625 Ill. Comp. Stat. Ann. 5/11-601 (2017). When your program starts, your program prompts a user to enter two numbers. The first number is your current driving speed in MPH (1 to 200 MPH, where I' and '200" are included). The second number is the absolute speed limit specified for the road you are currently running on (15 to 70 in MPH, where , 15, and 70 are included). The two numbers should be prompted by your program, one at a time (your current driving speed, followed by the speed limit). When a user makes any invalid input (i.e., invalid number), your program should detect it and repeat the prompt to a user. When a user made an inv speed limit (the second input), while the user had made a valid input to the first (the current driving speed), your program should prompt only for the second input (the speed limit), but alid input to the for the first input. After the two numbers are successfully entered, your should determine the penalty you may receive based on the following criteria (730 Il. Comp Stat. 5/5-45-55, 5/5-45-60 (2017)): Exceeding the speed limit by 1-20 MPH over the limit: "$120 fine Exceeding the speed limit by 21-25 MPH over the limit: "$140 fine . Exceeding the speed limit by 26-34 MPH over the limit: "Class B misdemeanor and n fines" Exceeding the speed limit by 35 MPH or more over the limit: "Class A misdemeanor and . carries up to one year in jail and a maximum $2,500 in fines" For example, if you are driving at 72MPH on a highway with 55MPH limit, a message: "you may receive a $120 fine" should be displayed on your local monitor. If your current speed is less than the speed limit, a message "you are a safe driver!" should be displayed. For each invalid input, "You made an invalid input for X. Enter a valid input for X.", where X is
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
