![]() |
|
#1
|
|||
|
|||
Coding HelpHey Guys I need some help in completing this code. Its for a final prject in my class. Its worth alot of my grade PLEASE AND THANK YOU!!!
JAVA Code:
method to complete: • buildList(): this method already grabs each individual word from the file. This method will add each word after it converts it to its lower case form, and if the word is not already in the list, and has a length greater than three characters. methods to be written by student • add(String wd): appends valid words to the list, updates the list count, and resizes the list if necessary • contains(String other): returns the position index if other is in the list, -1 otherwise • numCharacters(): returns the sum total of all characters of all the words in the list • wordsWithSubstr(String substr): returns a new WordList with every word in the list that contains the substr. For example, if substr is “mom”, and the word moment is in the list, then moment will be added to a new WordList as well as any other word that contains “mom”, whether “mom” is the first three characters, the last three characters, or three adjacent characters somewhere in the word. Then this new WordList is returned. Hint: you will probably want to use the indexOf() method of the String class in writing this method. • wordsWithLength(int value): returns a new WordList with every word in the list that has the length (or number of characters) of value • wordBefore(String word1) returns a new WordList with every word in the list, that comes before word1 alphabetically. word1 will not necessarily be in the list. For the following WordList list: {cat, ant, dog, ape, bear, monkey, rat} The statement WordList newList = list.wordBefore(“anvil”); will return: {ant } The statement WordList newList = list.wordBefore(“dog”); will return: {cat, ant, ape, bear} The statement WordList newList = list.wordBefore(“ant”); will return: { } // an empty list • findLongestWord(): returns the length of the longest word in the list: If relativity is the longest word this method returns 10, not relativity • longestWords(): returns a new WordList with every word in the list that has the same length (or number of characters) of the longest word in the list. Hint: You should use the methods findLongestWord() and wordsWithLength(int value) to solve this problem. I finished most of it. =/ Last edited by LuciWiz : 08-Apr-2008 at 02:53.
Reason: Please insert your Java code between [java] & [/java] tags
|
|||
|
#2
|
|||
|
|||
Re: Coding HelpWhat is the problem You have?
|
|
#3
|
|||
|
|||
Re: Coding HelpJust need help finishing the rest of the code following the requirements =/ please
|
|
#4
|
|||
|
|||
Re: Coding HelpQuote:
Hi This is simple example that you asked part of your posts. I thing you can catch the solution from this code JAVA Code:
Inside the if block you can check the existance of the word on your lists using loop. I hope it may helpfull to you best wishes to your project and course will be success. |
|
#5
|
|||
|
|||
Re: Coding Helpok i Understand it but to implement im going to need the add method which is one of the methods i also have to provide code for. Its due tonight by midnite HELP !! =/
|
Recent GIDBlog
Vista ?Widgets? on Windows XP by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Run exe file in C++ coding | sitha | C++ Forum | 4 | 01-Mar-2007 23:19 |
| coding wont read the file | shatred | C++ Forum | 3 | 02-Dec-2006 21:02 |
| Coding Contest #1 | davis | Miscellaneous Programming Forum | 0 | 12-Jun-2006 08:29 |
| Pls help in this coding. | harsha | C++ Forum | 5 | 08-Apr-2004 20:48 |
| C Coding Style | dsmith | Miscellaneous Programming Forum | 10 | 24-Feb-2004 06:23 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The