Question: 7. Create a static method called readAnOdd that takes a Scanner as an input parameter and returns a Boolean. The Boolean represents whether or not

 7. Create a static method called readAnOdd that takes a Scanner

7. Create a static method called readAnOdd that takes a Scanner as an input parameter and returns a Boolean. The Boolean represents whether or not the value that was typed in was an odd number. Each time the method is called it will attempt once to read an integer from the Scanner and return a true if it an odd number, and false if it is anything else (including letters, doubles, etc...). No screen outputs should happen in the method and it should be protected from crashing due to bad user inputs. As a design decision, you are not allowed to throw any new exceptions from your method. (8)

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!