I hope you still enjoy the daily challenges. Like i said before if you want you can also make a daily challenge. The challenge is then also to do it before i do.
Oddish vs. Evenish
Create a procedure that determines whether a number is Oddish or Evenish . A number is Oddish if the sum of all of its digits is odd, and a number is Evenish if the sum of all of its digits is even. If a function is Oddish , return "Oddish" . Otherwise, return "Evenish" .
For example, oddishOrEvenish(121) should return "Evenish" , since 1 + 2 + 1 = 4. oddishOrEvenish(41) should return "Oddish" , since 4 + 1 = 5.
public String OddishOrEvenish(int num){
int sum = 0;
String str = String.valueOf(num);
String[] n = str.split("(?<=.)");
for ( String i:n) {
sum += Integer.parseInt(i);
}
String result = "Oddish";
if(sum%2==0){
result = "Evenish";
}
return result;
}