Results 1 to 4 of 4
Thread: help in writing a program?
- 01-07-2013, 02:29 PM #1
Member
- Join Date
- Jan 2013
- Posts
- 1
- Rep Power
- 0
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
- 01-07-2013, 02:37 PM #2
AN21XX
- Join Date
- Mar 2012
- Location
- Munich
- Posts
- 297
- Rep Power
- 2
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!.gif)
- 01-07-2013, 03:22 PM #3
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.
- 01-10-2013, 04:06 PM #4
Member
- Join Date
- Mar 2010
- Posts
- 9
- Rep Power
- 0
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
-
Help with writing my own program
By DMarsh12 in forum New To JavaReplies: 4Last Post: 12-30-2011, 03:34 AM -
Writing a program(HELP!! It's due tommorrow!!!!!)
By mk3823 in forum New To JavaReplies: 9Last Post: 10-24-2008, 11:13 AM -
Due Tommorow Writing a Program Please Help
By gallimaufry in forum New To JavaReplies: 4Last Post: 10-23-2008, 03:15 AM -
how begin with writing a new program ?
By dimitrist in forum New To JavaReplies: 11Last Post: 05-13-2008, 03:49 AM -
Help needed writing a program...
By Francis in forum New To JavaReplies: 2Last Post: 11-22-2007, 02:03 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks