i was tring to figure out a problem which is:- if we had anumber like 123 then it must be converted to one hundred twenty three. though i figure it out it seems to be very less efficient and clumsy. can smbody give me an idea to make it in a good way, which looks more arranged and object oriented.
Post what ever you have done so far. People will help you in making the code better.
posted 14 years ago
main acctually i have just test my program, but it's not working properly, so i have decided to make it again frm scrach with sm new logic. now can sm1 help me out. previously i make an array of string like one, two, three ect. til nine and use it to genetrate value. but wht abt ten twenty, and many things like that.
i think i am confused, can smbody make a better approach.
Up to 20 or maybe from 10 to 20 you pretty much have to code as special cases. After that you can use modulo and division or just substringing to break out the tens, hundreds, thousands and so on, just as you would do using pencil & paper to write numbers. Share what you have with us and we'll be glad to see if we can help.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
WARNING! Do not activate jet boots indoors or you will see a tiny ad: