By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,433 Members | 1,328 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,433 IT Pros & Developers. It's quick & easy.

Number in Words

P: 3
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
Mar 8 '07 #1
Share this Question
Share on Google+
13 Replies


P: 94
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
Expand|Select|Wrap|Line Numbers
  1.  
  2.  cout<<"Enter a number: ";
  3.      cin>>je;
  4.      cout<<"In words: "<<tospell;
  5.  
remember code tags

What is tospell, is it your own function?

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

Expand|Select|Wrap|Line Numbers
  1.  
  2. cout << "In words: " << tospell(je) << end; 
  3.  
  4.  
You didn't really give any code.
The fault is not really there
Mar 8 '07 #2

P: 3
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
Mar 8 '07 #3

P: 3
Expand|Select|Wrap|Line Numbers
  1.  
  2.  cout<<"Enter a number: ";
  3.      cin>>je;
  4.      cout<<"In words: "<<tospell;
  5.  
remember code tags

What is tospell, is it your own function?

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

Expand|Select|Wrap|Line Numbers
  1.  
  2. cout << "In words: " << tospell(je) << end; 
  3.  
  4.  
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???
Mar 8 '07 #4

P: 1
is there "tospell" code in c++
Mar 8 '07 #5

P: 1
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!!!
Mar 8 '07 #6

Expert 100+
P: 1,510
what is tospell? apart from that you should be able to read an int into a
Expand|Select|Wrap|Line Numbers
  1. int a;
  2. cout<<"Enter a number";
  3. cin>>a;
Mar 8 '07 #7

P: 39
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.
Mar 8 '07 #8

P: 94
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

;-)
Mar 8 '07 #9

P: 94
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.
Mar 8 '07 #10

P: 94
Wait here is a way to start it:

Expand|Select|Wrap|Line Numbers
  1.  
  2. string tospell(int number)
  3. {
  4.      string tspell;
  5.      // Add some code 
  6.      return tspell;
  7. }
  8.  
  9.  
Mar 8 '07 #11

100+
P: 1,646
is there "tospell" code in c++
Are you by any chance aka jennlynannefelismino?
Mar 8 '07 #12

100+
P: 1,646
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
Mar 8 '07 #13

10K+
P: 13,264
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.
Mar 8 '07 #14

Post your reply

Sign in to post your reply or Sign up for a free account.