At 06:05 2007-04-28, jsdecastro28 wrote:
>Please help me,I'm really confuse....I'm new in this groups and also
>new in C++.I'm just starting to learn it
>
>My question is how will i write a program that will ask the user for
>an integer number and output the word equivalent of the input(1000-
>3000)limit inclusive
>
>example
>
>Input: 1954
>Output: one thousand nine hundred fifty-four
>
>Please give me the code.....thanks
>
>i dont know if this is right and what is the next step ????
>
>#include<iostream.h>
1st.... get a modern compiler ... iostream.h was never part of standard C++
>int main()
>
>{
> int num;
> cin>>num;
> if( num < 1000 || num > 3000)
>
>what will be the next...................................
I'd write a function that knows how to spell numbers and call it from here
it would likely be useful to have another function which knows how to
spell "one", "two", "three", "four", "five", "six", "seven", "eight"...... etc
then (for english) things like "ten", "eleven", "twelve", "thirteen", etc
then figure out how many thousands, and output one two or three
followed by "thousand"
and so on
when you get to <1000 you have to handle the ten eleven twelve....
stuff, not until
and you only output "zero" if the entire number is zero
>Please help me......I'm really new in C++
>I'm stuck with this problem
>
>Thanks....i hope someone will reply with this
>
>
>
>
>
>
>To unsubscribe, send a blank message to
><mailto:[EMAIL PROTECTED]>.
>Yahoo! Groups Links
>
>
>
Victor A. Wagner Jr. http://rudbek.com
The five most dangerous words in the English language:
"There oughta be a law"