473,395 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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
Mar 8 '07 #1
13 1977
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
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
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
is there "tospell" code in c++
Mar 8 '07 #5
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
horace1
1,510 Expert 1GB
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
lqdeffx
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
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
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
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
willakawill
1,646 1GB
is there "tospell" code in c++
Are you by any chance aka jennlynannefelismino?
Mar 8 '07 #12
willakawill
1,646 1GB
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
r035198x
13,262 8TB
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

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

Similar topics

21
by: Alex Martelli | last post by:
I hesitate a bit to post this, but... on the Italian Python NG, somebody was asking whether there was any way to convert an integer number x into a string which represents it in an arbitrary base N...
2
by: janet | last post by:
how can i count how many words have i written in a text area??? Like taking an example ... i am writing in this textarea of microsoft usergroup. and say in total i have written 50 words .. how...
9
by: cw bebop | last post by:
Hi all Using Visual Studio C# Have a string string st = "Hi, these pretzels are making me thirsty; drink this tea. Run like heck." ******
5
by: VJ | last post by:
Is there any known component that would convert a value entered as 40,000 to Forty Thousand.. Thanks VJ
4
by: JaredEmery | last post by:
Hello all, It's my first database, and I have a query that shows me the quantity, material, length, width and thicknesses of parts, and I'm using these figures to do some arithmetic on a report...
6
by: Gary Wessle | last post by:
hi I have a data file with equal number of columns for each row. I need to get the number of rows and columns to allocate a matrix in gsl. getline (in, line) and parse the line for the number of...
3
by: Nhd | last post by:
I have a question which involves reading from cin and counting the number of words read until the end of file(eof). The question is as follows: Words are delimited by white spaces (blanks,...
4
by: Robba | last post by:
I got a little problem, i have to return the number of the array of the word that is filled in. First there is filled in a sentence, and have to be split. I think i splitted it but now i cant...
6
by: jeddiki | last post by:
I am writing a little script that will improve authors writing skills by finding repeated phrases in the text. The text of a chapter will average about 10,000 words, however, I could reduce the...
2
by: alwaali | last post by:
Hi I need help please This is my project and i need a help to solve it with you A page of text is to be read and analyzed to determine number of occurrences and locations of different words. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.