Converting numbers to words...help! - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Converting numbers to words...help!

GorrisGorris Posts: 4Member
[color=Black][size=1]This is my first post so if I do something wrong let me know.I am reading the book practical C++ programming and having problems getting started with one of the practice problems. The problem says to take a number entered by the user and then convert it into words and print it to the screen.

I have the knowledge of how to take input from a user and print it to the screen but for some reason I can't seem to figure out how I would go out changing the number into text. Would I use and array, a string, or something else.

I just need a push in the right direction I don't want someone to write the program for me I have like coders block? haha Idk.

Anyhow any help would be appreiciated. [/size][/color]

Comments

  • Delta97Delta97 Posts: 2Member
    Uhm hi, i believe you are studying the "loops" section. If so what you should basicly write a "loop", with for or while or switch-case. Well in this case the best way to use is, uhm, well you didnt want to get spoiled so i wont tell^^

    But i think you overrated the problem, there is nothing unusual in the question since YOU will be the one writing the "words" like "one" "two" "three". And "somehow", you will tell the computer "if you see the number 1; printf the word 'one', if you see the number 2, printf the word 'two' etc.", got me?
  • Delta97Delta97 Posts: 2Member
    Uhm hi, i believe you are studying the "loops" section. If so what you should basicly write a "loop", with for or while or switch-case. Well in this case the best way to use is, uhm, well you didnt want to get spoiled so i wont tell^^

    But i think you overrated the problem, there is nothing unusual in the question since YOU will be the one writing the "words" like "one" "two" "three". And "somehow", you will tell the computer "if you see the number 1; printf the word 'one', if you see the number 2, printf the word 'two' etc.", got me?
  • trisnapdtrisnapd Posts: 4Member
    Very simple Numbers to Words with php.

    Example website Numbers to Words try in History Number dot Com

    [link=http://www.historynumber.com/]www.historynumber.com/[/link]
Sign In or Register to comment.