Skip to main content

Practice Code Structure

Section 1.15 Fill-in-the-blank

Checkpoint 1.15.1.

The numberCheck() function takes an integer and returns a String. Complete the function by filling in the blanks underneath, so that when the number is a multiple of 3 or 5 but not a multiple of 15, it returns "Good guess!". Otherwise, it returns "Not correct!". Reminder: You can use the % operator to check the remainder. For example, when a number is a multiple of 2, number % 2 == 0.
public static String numberCheck(int number) {
   if ((-----------Blank 1-------------) &&-------Blank 2-------) {
      return "Good guess!";
   } 
      return "Not correct!";
}
Put your responses here:
Blank 1:
Blank 2:
You have attempted 1 of 2 activities on this page.