Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert Integer to String

 
Nistor Alexandru
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2985
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 12097
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
looks a lot like one of our Cattle Drive assignments.

And yes, I personally have written it.
 
Henry Wong
author
Marshal
Pie
Posts: 20997
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Nistor Alexandru
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 160
IntelliJ IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12097
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic