Find Jobs
Hire Freelancers

Simple Project

$25-30 USD

Terminado
Publicado hace alrededor de 16 años

$25-30 USD

Pagado a la entrega
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.
ID del proyecto: 3699143

Información sobre el proyecto

5 propuestas
Proyecto remoto
Activo hace 16 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
See private message.
$22,95 USD en 1 día
5,0 (272 comentarios)
6,8
6,8
5 freelancers están ofertando un promedio de $24 USD por este trabajo
Avatar del usuario
See private message.
$21,25 USD en 1 día
4,7 (21 comentarios)
4,5
4,5
Avatar del usuario
See private message.
$25,50 USD en 1 día
4,5 (35 comentarios)
4,4
4,4
Avatar del usuario
See private message.
$25,50 USD en 1 día
4,7 (5 comentarios)
4,0
4,0
Avatar del usuario
See private message.
$25,50 USD en 1 día
4,9 (14 comentarios)
3,6
3,6

Sobre este cliente

Bandera de UNITED STATES
san antonio, United States
5,0
8
Forma de pago verificada
Miembro desde ene 28, 2008

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.