You are driving a little too fast, and a police officer stops you. a Write code to compute the result, encoded as an int
Posted: Wed Apr 27, 2022 5:05 pm
You are driving a little too fast, and a police officer stops you. a Write code to compute the result, encoded as an int value: 0 = no fine, 1 = small fine, 2 = big fine. If speed is 42 or less, the result is 0. If speed is between 43 and 67 inclusive, the result is 1. If speed is 68 or more, the result is 2. Unless it is your birthday on that day, your speed can be 5 higher in all cases. caughtSpeeding(41, false) = 0 caughtSpeeding(47, false) > 1 caughtSpeeding(47, true) - 0 For example: Test Result System.out.println(caughtSpeeding(40, false)); O