You can earn up to 5 points of extra credit by successfully…
You can earn up to 5 points of extra credit by successfully completing this question. A student in IST 140 is trying to write a method, caughtSpeeding(), and to call that method from the main() method. You’re a tutor who is helping the student to find the errors in his code and to correct them. The instructions the student received were as follows: You are driving a little too fast, and a police officer stops you. Write code to compute the result, encoded as an int value: 0: no ticket 1: small ticket 2: big ticket. The int values are determined as follows: If speed is 60 or less, the result is 0. If speed is between 61 and 80 inclusive, the result is 1. If speed is 81 or more, the result is 2. For all of the above, if it is the driver’s birthday, then the speed can be 5 higher in all cases. Your method should have the name caughtSpeeding, and should have parameters for speed and for whether it is the driver’s birthday. Call the caughtSpeeding() method from main(), and print the resulting return value (i.e., do not use System.out.println() from within the caughtSpeeding() method). Example 1: In the main() method, the statement: System.out.println(caughtSpeeding(90, false)); Should result in the output: 2 Example 2: In the main() method, the statement: System.out.println(caughtSpeeding(65, true)); Should result in the output: 0 The student’s code, which is not correct, is as follows: public class Main { public static boolean caughtSpeeding(int speed, boolean isBirthday, int ticketPrice) { if (isBirthday) { speed += 5; } if (speed >= 81) { return 2; } if (speed >= 61) { return 1; } else { return 0; } } public static void main(String[] args) { System.out.println(caughtSpeeding(90, false)); System.out.println(caughtSpeeding(65, true)); } } Correct the students’ code so that it runs correctly. You do not need to, and should not, make any changes to the main() method. Instead, copy the entire code block above, paste it into IntelliJ, and make the necessary changes to the caughtSpeeding() method. Then paste your entire corrected .java file into this box. Rubric: Program compiles and runs without throwing exceptions or entering an infinite loop (1pt) Declare method caughtSpeeding() with correct type of return value (1pt) Declare method caughtSpeeding() with correct number and type(s) of parameter variables (1pt) Correct output based on call to caughtSpeeding() (2pts)