![]() ![]() You can solve the problem more genrally by realizing it repeats after the hundreds case. Two things: You can save yourself a lot of if typing if you just index into an array. Name = name + digitName(part / 100) + " hundred" ![]() Name = digitName(part / 1000) + " thousand " Name = teenName(part / 1000) + " thousand " Name = tensName(part / 1000) + " thousand " I've been tinkering with it all day and looked at a lot of program examples online but everyone that I looked at is using techniques that are beyond me as a beginner. I got it working with numbers up to 20,999 but can't get it to work past that. The initial program converts numbers 1-1000 but then you are asked to modify the program to accept numbers up to 1,000,000. I came across this program in a book to convert a number to words. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |