I am at my wits end with this code.
I've been working on it for at least 2 weeks and the same error appears.
The error, itself, is the incompatible types error. It appears underneath the division symbol.
// DivideByFive.java - This program determines if a number is divisible by 5 and prints
// the result or the fact that the number is not divisible by five.
// Input: Interactive.
// Output: Result of division or message.
import javax.swing.*;
public class DivideByFive
{
public static void main(String args[])
{
int number;
String numberString;
numberString = JOptionPane.showInputDialog("Enter an integer: ");
number = Integer.parseInt(numberString);
// Test number here. If divisible by 5, call divideByFive(), else print message.
if (number / 5)
{
divideByFive(number);
}
else
{
System.out.println("Sorry, " + number + " is not divisible by 5 ");
}
} // End of main() method.
// Write divideByFive() method here.
public static void divideByFive(int number)
{
System.out.println(number + " is divisible by 5 ");
}
} // End of DivideByFive class.