Results 1 to 4 of 4
  1. #1
    zervine is offline Member
    Join Date
    Sep 2008
    Posts
    2
    Rep Power
    0

    Question Integer to String

    Can anyone please help me about our activity on BlueJ??

    the program output is Banking:

    Please Enter any amount: 15302
    Monetary breakdown
    1000= 15
    500= 0
    200= 1
    100= 1
    50= 0
    20= 0
    10= 0
    5= 0
    1= 2

    I need to convert the input amount into words...
    I already did the breakdown, i just need to conver it to words..
    Can anyone help me on this problem..? Need to finish this program badly..
    :( :(

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Seems you have to build a well formed algorithm for this. As a hint, start from the last digit, I mean the right most digit. Read the value and check there is another digit in the left hand side.

  3. #3
    zervine is offline Member
    Join Date
    Sep 2008
    Posts
    2
    Rep Power
    0

    Default

    Actually, we are using readline for this.
    And he said that we must use a swtich statement, but he said that we must first do a formula how the execution goes on converting the int to chararcter.
    The maximum input was 1million only.
    Can you give me formula o how do i convert it to words, i already use the case statement, but it will took so long before i made it.We also use a readstring in this program.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. String to Integer Conversion in JSP
    By vinikz in forum New To Java
    Replies: 8
    Last Post: 11-10-2010, 02:45 PM
  2. Replies: 4
    Last Post: 03-25-2008, 12:16 PM
  3. String to Integer conversion
    By eva in forum New To Java
    Replies: 2
    Last Post: 12-17-2007, 03:59 PM
  4. How to cast an Object into a specific type (Integer/String) at runtime
    By mailtogagan@gmail.com in forum Advanced Java
    Replies: 2
    Last Post: 12-03-2007, 01:04 PM
  5. Integer vs int
    By bugger in forum New To Java
    Replies: 1
    Last Post: 11-14-2007, 09:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •