English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Make a program that accepts a number ( number <=3000) and outputs its equivalent into words. Help me please...please

2007-11-13 20:11:40 · 4 answers · asked by sheryl lyn b 2 in Computers & Internet Programming & Design

4 answers

If you are stil stuck, you may contact a java expert at websites like http://askexpert.info/

2007-11-13 21:40:16 · answer #1 · answered by John R 4 · 0 1

This question has been asked before.

First you need to define a String array of numbers with length 10.
Place the text 'dummy' in entry zero.

Now define a String array of 10 teens. I will leave you to work out the text values to initialise this to.

Now define a string array of tens. ie. 'dummy', 'dummy', 'twenty', 'thirty'
(note: Ten is a teen number)

Now get your input number.
You now need to split your number into its digits. Putting the digits into an array may make the reading easier though this is not necessary.

Now process hundreds if there are any hundred digits.
This will be numbers followed by the word 'hundred'.

Now process the tens digit if there are any
if = 1 then use the teens array with the units
else
use the tens array and then if units use the numbers array

That should do it.

Good luck

2007-11-14 05:09:34 · answer #2 · answered by AnalProgrammer 7 · 0 1

Ok let's see...

If Me = Java.Programmer Then
Question.Answer = 1
Me.Rule = True
Else
You.Answer = 0 and You.Sorry = True
End if

2007-11-14 04:15:59 · answer #3 · answered by Anonymous · 0 1

hahah! the first answer was funny...

2007-11-14 04:20:21 · answer #4 · answered by Sam Daniel 4 · 0 1

fedest.com, questions and answers