Last active
June 24, 2017 15:28
-
-
Save khunzohn/18a6c6ca4862cb4ebcfb12dd1f0bb75b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Utils { | |
public static String mapDigitToWord(int digit) throws DigitRangeException { | |
if(digit < 0 || digit > 9) | |
throw new DigitRangeException(); | |
switch (digit) { | |
case 0: return "Zero"; | |
case 1: return "One"; | |
// case 2,3,...9 | |
default: return ""; | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment