i can give a quick run down of what your code should look like.
every number follows a particular pattern.
1000 = one thousand
2000 = two thousand
555 = five hundred and fifty five
556 = five hundred and fifty six
810 = eight hundred and ten
820 = eight hundred and twenty
this is the part where u have to use your brain. finding out what pattern the number applies to.
you must test each number like this (since 9999 is the highest number you want to go to i'll use that as my high range)
(int)(x / 1000) is going to give u 9. there you have the thousand's place.
have a switch statement that'll change the 9 to nine and concat thousand on it.
this small piece of code will ensure that x has 1 less place (in this case the thousands place)
Code:
x = x % 1000; //x will be 999
then (int)(999 / 100) gives u 9. hundreds place. a switch statement that does the same with 9 and concats hundred to the string....etc
Code:
x = x % 100; //x will be 99
from 99 downwards it's gonna be a little different. instead of 9 hundred and 9 thousand you must concat ninety (or eighty or seventy...you get the point ) to the string.
don't forget
Code:
x = x % 10; //x will be 9
pass x through switch statement again. the one's place will be either "one", "two",...."eight", "nine".
to test for numbers like 100, 5000....etc will return 0 when u do the MOD % operation on them.
Code:
6000 % 1000 //returns 0
Code:
500 % 100 //returns 0
Code:
6000 % 100 //WRONG: returns 60 and definitely not what we want here
hope u understand the very simple logic i'm trying to show you since we know 9999 will be the highest number and btw nested switch statements is the way to go.