Question: Write a method, computeTicketCode, that receives a vehicle's speed(int) detected by radar camera , and a boolean(isSchoolZone). Return appropriate code depending on received values as
Write a method, computeTicketCode, that receives a vehicle\'s speed(int) detected by radar camera , and a boolean(isSchoolZone). Return appropriate code depending on received values as described below:
method signature: public static int computeTicketCode(int speed, boolean isSchoolZone)
When NOT in a school zone: (false value received for isSchoolZone)
speed code
0-30 0
31-59 1
60-75 2
75+ 3
When IN a school zone (true value received for isSchoolZone)
speed code
0-20 0
21-50 1
51-60 2
61+ 3
Step by Step Solution
3.45 Rating (152 Votes )
There are 3 Steps involved in it
To write the method computeTicketCode that calculates the ticket code based on the speed and whether ... View full answer
Get step-by-step solutions from verified subject matter experts
