aspose file tools*
The moose likes Beginning Java and the fly likes Convert Integer to String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Convert Integer to String" Watch "Convert Integer to String" New topic
Author

Convert Integer to String

Nistor Alexandru
Greenhorn

Joined: Oct 08, 2011
Posts: 7
Hi a friend of mine asked me to create a program that turns Integers into strings for example if I input the number 21 the computer needs to convert it into twenty-one.Has anyone done something similar before I have to do it in another language I just need to see how I should proceed in this.Furthermore I also want the computer to convert the number from arabic digits into roman digits example : 21 to XXI.Anyone no of a program writen in java or javascript that does something similar?
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2861
    
  11

Was your friend also your teacher? What you should do is make an attempt to write this program, and if you have any questions about anything in particular, we'd be glad to help.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11480
    
  16

looks a lot like one of our Cattle Drive assignments.

And yes, I personally have written it.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 19004
    
  40

Nistor Alexandru wrote:Hi a friend of mine asked me to create a program that turns Integers into strings for example if I input the number 21 the computer needs to convert it into twenty-one.Has anyone done something similar before I have to do it in another language I just need to see how I should proceed in this.Furthermore I also want the computer to convert the number from arabic digits into roman digits example : 21 to XXI.Anyone no of a program writen in java or javascript that does something similar?


Wow.... I had the same homework problem, more than 20 years ago, when I was a freshman in college. Of course, back then, it had to be done in BASIC. It is amazing how homework problems remain the same year after year.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Nistor Alexandru
Greenhorn

Joined: Oct 08, 2011
Posts: 7
If you must know I am trying to learn to program on my own I am 22 and barely finished Head first Java I am still barely understanding programming concepts but if asking for help is such a problem then so be it
Riaan Nel
Ranch Hand

Joined: Apr 23, 2009
Posts: 160

Nistor Alexandru wrote:If you must know I am trying to learn to program on my own I am 22 and barely finished Head first Java I am still barely understanding programming concepts but if asking for help is such a problem then so be it

You're welcome to ask for help, but there's a difference between asking for help and asking for a complete program (as you did at the end of your first post).

Before you write any code, take a pen and a piece of paper and determine what the program should do and how it should do it. Once you've figured that out you can start working on a Java program. If you get stuck with the program, show us what you've tried and we'll be glad to help.


"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." - George Bernard Shaw
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11480
    
  16

Nistor Alexandru wrote: I...barely finished Head first Java I am still barely understanding programming concepts

I would suggest that you got back to HFJ and work through stuff you still find difficult/confusing. Everything you do builds off what you've done before, so if your fundamentals are shaky, you're in trouble trying to go forward.

We love to help. We love to answer questions. Ask here. Be forthcoming with with what your doing, where your examples come from, what your code does, what you expect...etc. the more you give us, the easier it is to help.

On the flip side, don't give us TOO much information. if you have 200 lines of code, but are only confused about one, don't post all of it...post a small, self-contained example that someone here can compile and run that illustrates your problem.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Convert Integer to String