Results 1 to 5 of 5
  1. #1
    Gmoon_90 is offline Member
    Join Date
    Jul 2011
    Posts
    3
    Rep Power
    0

    Unhappy Need alot of help with programming asentence abbreviation algorithm :(

    Hello , ive been asked to write a java program that does the following :-

    1- ask the user to input a sentence (heir entry may contain spaces, digits, and/or punctuation characters) which is probably the only thing i know how to do sadly ..

    2- all single character words remain in the output String.

    3- remove all vowels that are not single word characters from the output sentence.

    4-all double characters will be single char even if there is spaces between words

    5- numbers and spaces including punctuation remains in the output string

    ... the problem is that im a beginner at using JCreator .. actually at java itself so this program was really hard to me to try to write i know i have to use loop but cant implement it right pretty frustrating so any tips would be really helpful

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

    Default

    Start simply and add to it.
    First get the sentence from the user. See the Scanner class for console line input

    Look at the String class for methods to use with the String which is what you'll read with the Scanner class.

  3. #3
    Gmoon_90 is offline Member
    Join Date
    Jul 2011
    Posts
    3
    Rep Power
    0

    Default

    so far ive got to scanning the answer and saving it in StrIn which is my string input ive read some threads and searched about removing the vowels tho i still dont know how to leave it if it single char

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

    Default

    i still dont know how to leave it if it single char
    What defines a single character?
    What separates characters? Spaces, commas, semicolons

  5. #5
    Gmoon_90 is offline Member
    Join Date
    Jul 2011
    Posts
    3
    Rep Power
    0

Similar Threads

  1. A* algorithm
    By zjames in forum New To Java
    Replies: 6
    Last Post: 11-25-2010, 12:02 PM
  2. Abbreviation in Java
    By somnath6088 in forum New To Java
    Replies: 2
    Last Post: 11-08-2010, 07:59 AM
  3. Algorithm help? :)
    By Mirix in forum New To Java
    Replies: 6
    Last Post: 05-24-2010, 02:08 AM
  4. My encrypting thingy lags alot..
    By Addez in forum New To Java
    Replies: 3
    Last Post: 09-15-2009, 11:33 PM
  5. Help with an Algorithm
    By Manfizy in forum New To Java
    Replies: 22
    Last Post: 07-03-2009, 07:16 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
  •