Results 1 to 4 of 4
  1. #1
    baldy100 is offline Member
    Join Date
    Jan 2013
    Posts
    1
    Rep Power
    0

    Default help in writing a program?

    I need help in writing a program,I am new to java and am using jcreator.I am having trouble incorporating methods in the programs.Below is a program i am stuck on.If possible could some one help me out.It would be great if someone could do a draught so i could understand it from studying it..here is how the interface should look and i think it should have 2 returning methods.

    Input a sentence: This i$ an aardvaAr yeEeeAs onDO qwerty XYZ9


    Sentence Statistics:

    The number of valid words 6
    The valid words are This an aardvaAr yeEeeAs onNO qwerty

    The word with the largest number of vowels yeEeeAs
    The word with the largest number of consonants qwerty
    The longest word with an equal no of vowels and consonants onDO

  2. #2
    Sierra is offline AN21XX
    Join Date
    Mar 2012
    Location
    Munich
    Posts
    297
    Rep Power
    3

    Default Re: help in writing a program?

    You should start your own code, as you will not get your code written here. I doubt you get such assignment without having the means or information to do it.
    I suggest you design a class with the main() method for a start.
    Maybe you want to take a look here on how to scan for inputs Java Input Using Java Scanner

    When you are so far that this runs you may try to go on and post if you are struck on a problem, right?
    I like likes!

  3. #3
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    356
    Rep Power
    5

    Default Re: help in writing a program?

    Break up the problem into steps. The first step would probably be to break your sentence up into individual Strings that you can analyze. Give that a try.

  4. #4
    Clown is offline Member
    Join Date
    Mar 2010
    Posts
    9
    Rep Power
    0

    Default Re: help in writing a program?

    Hi, I am also a newbie, but this is what I would do.
    -I would read the text with the java scanner and save it in an String.
    -Next I would remove all double blank spaces to make the String easier to analyze and will add a blank space in the end if there isnt one.
    -Next I would loop through my new String and save all substrings which are starting and ending with " " in a new list of Strings.
    -Now I would make 2 constants "aoeiuy" and "qwrtzp....." and check for each character of your word if it is part of vowels and part of consonants.

    Again, I have a close to none java experience and I probably have errors in my thought process. I will try to implement it and will see if I can get this to work, but it will take time.............

    Best,
    Yordan

Similar Threads

  1. Help with writing my own program
    By DMarsh12 in forum New To Java
    Replies: 4
    Last Post: 12-30-2011, 03:34 AM
  2. Writing a program(HELP!! It's due tommorrow!!!!!)
    By mk3823 in forum New To Java
    Replies: 9
    Last Post: 10-24-2008, 11:13 AM
  3. Due Tommorow Writing a Program Please Help
    By gallimaufry in forum New To Java
    Replies: 4
    Last Post: 10-23-2008, 03:15 AM
  4. how begin with writing a new program ?
    By dimitrist in forum New To Java
    Replies: 11
    Last Post: 05-13-2008, 03:49 AM
  5. Help needed writing a program...
    By Francis in forum New To Java
    Replies: 2
    Last Post: 11-22-2007, 02:03 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
  •