r/dailyprogrammer • u/nottoobadguy • Feb 16 '12
[2/16/2012] Challenge #8 [intermediate]
Write a program that will print the english name of a value. for example, "1211" would become "one-thousand, two hundred, eleven".
for extra credit, allow it to read the english value of a number and output the integer.
input: one-hundred, four output: 104
11
Upvotes
View all comments
Show parent comment
1
u/Captain_Sabatini Feb 17 '12
You might want to add a case for 0 in tys that just prints "and " or "n " just to be consistent if the number is something like 1102.
Also, you have no way to say tyn itself.
But then again I didn't even submit anything for this challenge. I just had to judge yours because it had character.