hasOddEven
Category: Programming
Author: Stuart Reges
Book Chapter: 5.2
Problem: hasOddEven
Write a static method called hasOddEven that takes
three integers as parameters and that returns true if there is at least one
odd and at least one even among the three numbers and that returns false
otherwise. Below are some sample calls and the appropriate value to return.
Method Value Method Value
Call Returned Call Returned
------------------------------- -------------------------------
hasOddEven(2, 4, 6) false hasOddEven(14, 7, 5) true
hasOddEven(2, 3, 4) true hasOddEven(5, 4, 2) true
hasOddEven(12, 4, 17) true hasOddEven(13, 20, 91) true
hasOddEven(5, 17, 4) true hasOddEven(7, 19, 5) false
You may assume that all three integers passed to your method are greater
than or equal to 0.