Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Convert Integer to String  RSS feed

 
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?
 
Sheriff
Posts: 3015
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.
 
lowercase baba
Bartender
Posts: 12610
50
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.
 
author
Sheriff
Posts: 23394
138
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
 
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
Posts: 12610
50
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.
 
This parrot is no more. It has ceased to be. Now it's a tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!