Question: this is the starter code to use Create a function named oddishOrEvenish that receives a single integer as a parameter, then returns Oddish if the
this is the starter code to useCreate a function named oddishOrEvenish that receives a single integer as a parameter, then returns "Oddish" if the integer is oddish, and returns "Evenish" if the integer is Evenish. A number is Oddish if the sum of all of its digits are odd, and Evenish if the sum of all of its digits are even. Header: String oddishorEvenish( int num ) \{ // Type code here \} Example Input/Output: - Input: 43 Output: "Oddish" (since 4+3 equals 7) - Input: 373 Output: "Oddish" (since 3+7+3 equals 13) - Input: 4433 Output: "Evenish" (since 4+4+3+3 equals 14 Hints: - Use the num \% 10 expression to extract the last digit from a number - Use the num / 10 expression to remove the last dight from a number - Use the num \%2 expression to determine if a number is even or odd. For Multiple Files, Custom Library and File Read/Write, use our new - Advanced Java IDE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
