Number in Words

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jennlynannefelismino
    New Member
    • Mar 2007
    • 3

    Number in Words

    int je;
    cout<<"Enter a number: ";
    cin>>je;
    cout<<"In words: "<<tospell;

    i think there is something wrong with my code, will you please someone help with this output??? example:
    Enter a number: 81
    eighty one
  • Extremist
    New Member
    • Jan 2007
    • 94

    #2
    Originally posted by jennlynannefeli smino
    int je;

    i think there is something wrong with my code, will you please someone help with this output??? example:
    Enter a number: 81
    eighty one
    Code:
     
     cout<<"Enter a number: ";
         cin>>je;
         cout<<"In words: "<<tospell;
    remember code tags

    What is tospell, is it your own function?

    If it is wouldn't it look something like this?

    Code:
    cout << "In words: " << tospell(je) << end;
    You didn't really give any code.
    The fault is not really there

    Comment

    • jennlynannefelismino
      New Member
      • Mar 2007
      • 3

      #3
      answer

      int a;
      cout<<"Enter a number";
      cin>>a>>tospell ;

      there is something wrong in my output will you please help me???
      Example
      Enter a number: 1
      one

      Comment

      • jennlynannefelismino
        New Member
        • Mar 2007
        • 3

        #4
        Originally posted by Extremist
        Code:
         
         cout<<"Enter a number: ";
             cin>>je;
             cout<<"In words: "<<tospell;
        remember code tags

        What is tospell, is it your own function?

        If it is wouldn't it look something like this?

        Code:
        cout << "In words: " << tospell(je) << end;
        You didn't really give any code.
        The fault is not really there

        i write "tospell", so the number i type will automatically convert into words... what should i put so???

        Comment

        • sherry may lastimosa
          New Member
          • Mar 2007
          • 1

          #5
          c++

          is there "tospell" code in c++

          Comment

          • screwlay
            New Member
            • Mar 2007
            • 1

            #6
            Originally posted by jennlynannefeli smino
            i write "tospell", so the number i type will automatically convert into words... what should i put so???

            I think you should study your lesson well!!!
            Read Books!!!
            Don't just ask here!!!
            Goodluck!!!

            Comment

            • horace1
              Recognized Expert Top Contributor
              • Nov 2006
              • 1510

              #7
              what is tospell? apart from that you should be able to read an int into a
              Code:
              int a;
              cout<<"Enter a number";
              cin>>a;

              Comment

              • lqdeffx
                New Member
                • Mar 2007
                • 39

                #8
                honestly, i have never came across a function called this and doubt that a "tospell" function exists; however, depending on what you need to accomplish, might be able to do it with 1 or 2 function calls.

                Comment

                • Extremist
                  New Member
                  • Jan 2007
                  • 94

                  #9
                  Let me get this straight, excuse me if I'm wrong,
                  Are you expecting to us to write tospell for you?

                  The idea is that you write it yourself and we help you by telling you where you went wrong, you have to try first.

                  You go and write it first, post your attempt and then we'd be happy to help

                  ;-)

                  Comment

                  • Extremist
                    New Member
                    • Jan 2007
                    • 94

                    #10
                    No there is not a tospell,
                    The poster only put it there to demonstrate what he/she wanted done.

                    Don't worry, you're not missing anything.

                    Comment

                    • Extremist
                      New Member
                      • Jan 2007
                      • 94

                      #11
                      Wait here is a way to start it:

                      Code:
                      string tospell(int number)
                      {
                           string tspell;
                           // Add some code 
                           return tspell;
                      }

                      Comment

                      • willakawill
                        Top Contributor
                        • Oct 2006
                        • 1646

                        #12
                        Originally posted by sherry may lastimosa
                        is there "tospell" code in c++
                        Are you by any chance aka jennlynannefeli smino?

                        Comment

                        • willakawill
                          Top Contributor
                          • Oct 2006
                          • 1646

                          #13
                          Originally posted by jennlynannefeli smino
                          int a;
                          cout<<"Enter a number";
                          cin>>a>>tospell ;

                          there is something wrong in my output will you please help me???
                          Example
                          Enter a number: 1
                          one
                          It works better if you keep your question to one thread

                          Comment

                          • r035198x
                            MVP
                            • Sep 2006
                            • 13225

                            #14
                            Please no double/tripple posting.

                            You need to think up a plan of doing this and get to work quickly. No one is going to do this for you. If you don't want to learn at all and just want to copy someone else's work you can search the threads here. This has been done many times before. It would be ashame if you decide to just copy someone else's code.

                            Comment

                            Working...