Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By JosAH

Thread: Can someone tell me how to read an integer and verbalizes it.

  1. #1
    LHK
    LHK is offline Member
    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    Default Can someone tell me how to read an integer and verbalizes it.

    Hi all, I'm new to java programming. mind someone give me hints as above mentioned in the title.

    My question is, if i type in "44" the program would display "Forty-Four".

    Thanks

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,336
    Blog Entries
    7
    Rep Power
    20

    Default Re: Can someone tell me how to read an integer and verbalizes it.

    A few hints: verbalize numbers < 20 literally and keep a list of 'tens', i.e. "twenty", "thirty", "fourty" etc. Also keep a list of magnitudes, i.e. "hundred", "thousand", "million" and "billion". Pay special attention to the number zero.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Can someone tell me how to read an integer and verbalizes it.

    Quote Originally Posted by JosAH View Post
    A few hints: verbalize numbers < 20 literally ...
    I knew a little child who used to count "One, two, three ... seventeen, eighteen, nineteen, plenty"

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,336
    Blog Entries
    7
    Rep Power
    20

    Default Re: Can someone tell me how to read an integer and verbalizes it.

    Quote Originally Posted by DarrylBurke View Post
    I knew a little child who used to count "One, two, three ... seventeen, eighteen, nineteen, plenty"

    db
    Cute; my old professor frequently started his talks with "for any arbitrarily large number, say 3, ..."

    kind regards,

    Jos
    DarrylBurke likes this.
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    LHK
    LHK is offline Member
    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    Default Re: Can someone tell me how to read an integer and verbalizes it.

    thanks. let me try it out.

Similar Threads

  1. Integer Comparison, Outputting Largest Integer Not Working
    By killingthemonkey in forum New To Java
    Replies: 4
    Last Post: 10-16-2011, 08:59 PM
  2. Replies: 2
    Last Post: 12-14-2010, 08:01 PM
  3. Read user input into integer array
    By varunb in forum New To Java
    Replies: 12
    Last Post: 07-09-2010, 12:50 PM
  4. convert unsigned integer to signed integer in java?
    By diskhub in forum New To Java
    Replies: 6
    Last Post: 05-17-2010, 12:50 AM
  5. file read as integer.
    By makpandian in forum New To Java
    Replies: 4
    Last Post: 12-14-2008, 06:36 AM

Posting Permissions

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