HackerRank Java If-Else problem solution

HackerRank Java If-Else problem solution