Question: JAVA Write a boolean method called isOdd() in a class called OddTest, which takes an int as an argument and returns true if the int

JAVA

Write a boolean method called isOdd() in a class called OddTest, which takes an int as an argument and returns true if the int is odd, false if its not. The signature of the method is as follows: public static boolean isOdd(int number) Also write a main() method that prompts user for a number, calls the method isOdd sending the number and prints "ODD" or "EVEN" depending on the returned value of the method. You should test for negative input.

Run the program. Use the number 13. Run it again, use -2. Capture the console output.

Put the program code and output at the end of your text file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!