Determine if a String is even or odd. An even number has a remainder of zero when being divided by two. An odd number is any number that does not have a remainder of zero when being divided by two.
I would really appreciate if someone can help me with this Lab05c
import static java.lang.System.*;
import java.util.Scanner;
public class Lab05c
{
public static void main ( String[] args )
{
}
}
----------------------------------------------------------------------------------------------------
import static java.lang.System.*;
import java.util.Scanner;
public class StringOddOrEven
{
private String word;
public StringOddOrEven()
{
}
public StringOddOrEven(String s)
{
word = s;
}
public void setString(String s)
{
word = s;
}
public boolean isEven()
{
return false;
}
public String toString()
{
String output="";
return output;
}
}
Sample Data :
cat
boot
it
a
eleven
thirteen
odd
even
Sample Output :
Enter a word :: cat
cat is odd.
Enter a word :: boot
boot is even.
Enter a word :: it
it is even.
Enter a word :: a
a is odd.
Enter a word :: eleven
eleven is even.
Enter a word :: thirteen
thirteen is even.
Enter a word :: odd
odd is odd.
Enter a word :: even
even is even.