Answer:
public static boolean isDivisibleBy5(int number) {
boolean isTrue = true;
if (number % 5 == 0)
isTrue = true;
else
isTrue = false;
return isTrue;
}
Explanation:
- Create a method called isDivisibleBy5 that takes one parameter, an integer number
- Inside the method, create a boolean variable, isTrue, that will be used to store the result
- Check if the number is divisible by 5, using the module operator. If it is, set the isTrue as true. Otherwise, set the isTrue as false
- Return the isTrue