Find Jobs
Hire Freelancers

Simple Project

$25-30 USD

Completato
Pubblicato circa 16 anni fa

$25-30 USD

Pagato al completamento
Very small task, programmer must be familiar with Java and the eclipse software. I will need it by tomorrow at 11:00 pm central time USA 2/8/08. ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Deliverables must be in ready-to-run condition. Must include the Hand-in Requirements files Objectives: * Use the SetADT in more sophisticated applications * Handle exceptions and other conditions * Work with iterators * Use object composition Hand-in Requirements; * Source for UniqueWordSet * Source for [login to view URL] All projects and laboratories will be submitted electronically through webCT. Zip up your entire project directory to submit as the source. (Right click on the project folder and follow the SentTo link.) Overview: In this laboratory you will be developing an application that counts the number of occurrences of each word in a text file. The counting will be done by a UniqueWordSet. The UniqueWordSet is a class that has the following methods: public int getCount( ); // returns total number of words counted public int getCount(String word); // returns count for word public int getCountUnique( ); // returns total number of unique words public boolean isEmpty( ); // true if no words in Set public Iterator iterator( ); // iterates over StringCounter items in Set public String toString(); // for debugging public void updateCount(String word); // updates count for word, adds a // new entry first time word is encountered The getCount method returns the number of words that have been counted. The getCount(String word) method returns the number of times word has been counted. The getCountUnique returns the number of unique words that have been counted. The iterator method returns a StringCounter iterator that visits entries for the unique words that have been encountered (see below). The updateCount method adds 1 to the count of the number of times word has been seen so far. (Of course if this is the first time that word has been seen, the UniqueWordSet first adds an entry for word.) The UniqueWordSet class should contain a SetADT. Implement the methods of UniqueWordSet in terms of those of SetADT. (All of the methods of UniqueWordSet will be very short.) In the implementation, you should keep items of type StringCounter in the underlying SetADT. For convenience, the following classes are provided for this laboratory: * [login to view URL]: The StringCounter class has the following constructor and methods: public StringCounter(String word); // The String to be counted public int getCount( ); //returns total number of words counted public String getString( ); //returns String represented by this object public void increment( ); // increments the count public String toString( ); // returns a String representing object state * [login to view URL]: This is the same class as in Laboratory 2. The WordReader class has the following constructor and implements the Iterator interface: public WordReader(String filename) throws IOException; // fails if can't open the file Part I: Setting up the project Download the [login to view URL] file and import it into your Eclipse workspace as a starting point for this project. Use File -> Import > General -> Existing Projects into Workspace -> Select Archive File to import the zip file, see the "Bringing your program home" section in [login to view URL]~javalab/lab/eclipse/[login to view URL] for more details on how to import the zipped project. This project contains the StringCounter and WordReader classes as discussed above as well as the files needed from the jss2 package. The project also contains the data files: * [login to view URL] * [login to view URL] * [login to view URL] Add a UniqueWordSet class that has a constructor, but no main and a UniqueWordSetTester class that has a main only. Compile and save your project. Add a line to UniqueWordSetTester that outputs the message This program was written by YOURNAME. Part II: Implementing the UniqueWordSet Implement and test the UniqueWordSet. This class has-a SetADT that holds the words. During the recitation, the class will discuss how the methods of UniqueWordSet work and define the attributes of UniqueWordSet. The constructor, the isEmpty, the getCount(), the iterator, and the toString methods will be implemented and tested. You will write the remaining methods on your own. Test your program by creating a UniqueWordSet called testSet, adding the words "the", "bank", "the", and "green". Part III: Implement a createWordSet Since creating a UniqueWordSet from the contents of a file is something that you will want to do frequently in testing, add a static method called createWordSet to UniqueWordSetTester with the following signature: public static UniqueWordSet createWordSet(String filename) throws IOException The createWordSet method returns a newly created UniqueWordSet that contains the words in the file filename. Test createWordSet by calling it to create UniqueWordSet objects for [login to view URL] and simple.txt. Use the WordReader class to read in the words. Part IV: Additional testing and implementation On your own, create a UniqueWordSet called poeSet for the file poe.txt. Using the poeSet, output the total number of words in the document and the number of unique words in the document. Also output the average word length of the words encountered. (Hint: this is a weighted average, where the length of each unique word is weighted by the number of times that it has occurred.) ## Platform Program must be coded in Java language using the Eclipse programming software. Windows XP based.
Rif. progetto: 3699143

Info sul progetto

5 proposte
Progetto a distanza
Attivo 16 anni fa

Hai voglia di guadagnare un po'?

I vantaggi delle offerte su Freelancer

Imposta il tuo budget e le scadenze
Fatti pagare per il lavoro svolto
Delinea la tua proposta
La registrazione e le offerte sui lavori sono gratuite
Assegnato a:
Avatar dell'utente
See private message.
$22,95 USD in 1 giorno
5,0 (272 valutazioni)
6,8
6,8
5 freelance hanno fatto un'offerta media di $24 USD
Avatar dell'utente
See private message.
$21,25 USD in 1 giorno
4,7 (21 valutazioni)
4,5
4,5
Avatar dell'utente
See private message.
$25,50 USD in 1 giorno
4,5 (35 valutazioni)
4,4
4,4
Avatar dell'utente
See private message.
$25,50 USD in 1 giorno
4,7 (5 valutazioni)
4,0
4,0
Avatar dell'utente
See private message.
$25,50 USD in 1 giorno
4,9 (14 valutazioni)
3,6
3,6

Info sul cliente

Bandiera: UNITED STATES
san antonio, United States
5,0
8
Metodo di pagamento verificato
Membro dal gen 28, 2008

Verifica del cliente

Grazie! Ti abbiamo inviato tramite email il link per richiedere il tuo bonus gratuito.
Non è stato possibile inviarti l'email. Riprova per piacere.
di utenti registrati di lavori pubblicati
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Caricamento anteprima
Autorizzazione per la geolocalizzazione concessa.
La tua sessione è scaduta ed è stato effettuato il log out. Accedi nuovamente per piacere.