Results 1 to 12 of 12
  1. #1
    scol2493 is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Default Counting words java applet

    Can anyone please help me! Very stuck on an assignment i need to code a java applet so that it counts the lengths of words for example i am a man would produce the output 2 - one letter words 1 - two letter word and 1 - three letter word.

    Thank you!

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

    Default

    it counts the lengths of words
    See the String class for methods to help you.
    Then consider where you would hold the counts for various word lengths.

  3. #3
    scol2493 is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Default

    Thank you for your help, i have read numerous textbooks about the string class i just can't seem to get my head round this! Is there anything else you can suggest to do? Also i am not allowed to use the swing library. Thank again

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,969
    Rep Power
    8

    Default

    What have you tried? How would you do this by hand, or with a piece of paper and a pencil?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    scol2493 is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Default

    I am completely clueless, been reading up on parsing. Just a beginner!

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

    Default

    Is there anything else
    No, I think the String class is the one to use.
    What methods of the String class look like they would tell you how many characters are in the String?

  7. #7
    scol2493 is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Default

    word count, char count?

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

  9. #9
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

    Default

    word count, char count?
    What does that post mean? Please explain.

  10. #10
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

    Default

    word count, char count?
    What does that post mean? Please explain.

  11. #11
    scol2493 is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Default

    Am i not allowed to cross post is that bad? i'm not sure, is there anything else you can suggest?

  12. #12
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

    Default

    is there anything else you can suggest
    Yes I suggest that you read the API doc for the String class

Similar Threads

  1. counting words within a file
    By justOne in forum New To Java
    Replies: 18
    Last Post: 07-25-2011, 02:15 PM
  2. Writing a java applet that converts numbers to words
    By derekmski in forum Java Applets
    Replies: 1
    Last Post: 04-16-2011, 03:33 AM
  3. Counting Words
    By Shyamz1 in forum New To Java
    Replies: 9
    Last Post: 03-03-2011, 01:12 PM
  4. Counting words
    By Wasley in forum New To Java
    Replies: 9
    Last Post: 01-30-2011, 10:57 PM
  5. Counting problem in java
    By hei1233212000 in forum New To Java
    Replies: 5
    Last Post: 07-07-2010, 03:46 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
  •