What would be printed if the method caughtSpeeding was called from main as follows: Note: there are no errors in this co
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What would be printed if the method caughtSpeeding was called from main as follows: Note: there are no errors in this co
What would be printed if the method caughtSpeeding was called from main as follows: Note: there are no errors in this code int result - caughtSpeeding(75, false); if (result 0){ System.out.println("No ticket"); } else if (result 1) { System.out.println("Lower fine"); } else { System.out.println("Higher fine"); } public static int caughtSpeeding(int speed, boolean isBirth if(speed > 65 && speed <= 85 && isBirthday) { return 0; } ir speed 3= 66 but shirthday ) return 21 3 it (speed <= 65 && isBirthday) { return 8; 1 * (speed > 60 && speed - 80) { return 1; 1 if (speed >= 81) { > return 2; } else { return; }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!