There are two parts I need help with.
Here is my code for the first method
public static boolean isOdd (int x)
{
if (x%2==1)
{
return true;
}
else
{
return false;
}
}
I declared this in a separate file than my main method and I need to know how to test it in the main method.
2.
public static boolean closeAccount (double acctBalance, int checksLeft) {
if ((acctBalance < 0)||(checksLeft <= 0))
return true;
else
return false;
// returns true if acctBalance is less than zero or checksLeft is less than or equal to zero.
}
public static boolean closeAccount (int acctBalance, int checksLeft) {
if ((acctBalance < 0)||(checksLeft <= 0))
return true;
else
return false;
I also need to know how to test these two methods in the main method.