subject

The purpose of this programming project is to demonstrate a significant culmination of most constructs learned thus far in the course. This includes Lists, Classes, accessors, mutators, constructors, implementation of Comparable, Comparator, use of Collections sort, iterators, properly accessing fields of complex objects, and fundamental File I/O.

You will create a LinkedList of Word objects using all the words found in the input file words. txt. A Word object contains 2 String fields; 1 to store a word in its normal form and the other to store a word in its canonical form. The canonical form stores a word with its letters in alphabetical order, e. g. bob would be bbo, cat would be act, program would be agmoprr, and so on. The class Word constructor has the responsibility of storing the normal form of the word in the normal form field and converting the normal form into the canonical form which is stored in the canonical form field (you should call a separate method for this conversion purpose).

Once all the words from the input file have been properly stored in a LinkedList of Word, you should use Collections to sort this list ascending alphabetically based on the canonical words by making the Word class Comparable.

Using an Iterator on the LinkedList of Word, create a 2nd list (new LinkedList) consisting of objects of a new class named AnagramFamily. AnagramFamily should contain at least 2 fields; 1 to hold a list of "Word" words that are all anagrams of each other (these should all be grouped together in the original canonical sorted list), and the 2nd field to store an integer value of how many items are in the current list. (Keep in mind, because the original list contains both the normal and canonical forms, as the AnagramFamily List will also have, a family of anagrams will all have the same canonical form with different normal forms stored in the normalForm field of the Word class). Each AnagramFamily List of Word should be sorted Descending by normal form using a Comparator of Word (if you insert Word(s) into a family one at a time, this presents an issue on how to get this list sorted as each Word insertion will require a new sort to be performed to guarantee the list is always sorted. For this reason it is best to form a list, sort it, and then create an AnagramFamily by passing the sorted list to it).

Sort the AnagramFamily LinkedList in descending order based on family size by use of a Comparator to be passed to the Collections sort method.

Next, output the top five largest families then, all families of length 8, and lastly, the very last family stored in the list to a file named "out6.txt." Be sure to format the output to be very clear and meaningful.

Finally, the first 4 people to complete the assignment should post their output results to the Canvas discussion forum for the remaining students to see the correct answer.

Be sure to instantiate new objects whenever transferring data from one object to another. Also, be sure to include various methods for manipulation and access of fields as well as helper methods to reduce code in main, such as the input/output of file data (like all other assignments, you will be graded on decomposition, i. e. main should not contain too many lines of code).

Part of your grade will depend on time. If written correctly (use of iterators and care taken when creating the anagram families), the running time should be less than 3 seconds. Programs that take longer will lose points based on the time. As encouragement to consider all options for speed, programs taking 1 minute will receive a 40 point deduction. Any longer than 3 minutes will receive only minimal points (10) for effort.

Though the basic algorithms involved are straight forward enough, there is a great deal of complexity involved with various levels of access to specific data. As mentioned before and never so importantly as with this assignment, start early and set a goal for completion by this weekend. Trust me, this is sound advice.

As a reminder, you will create at least 5 files: the driver, Word class, AnagramFamily class, and 2 comparators: 1 to compare Word objects for sorting descending based on the normal form of Word objects and 1 to compare AnagramFamily sizes for a descending sort.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
Aconstruction company is creating a powerpoint presentation describing how they calculate costs during each construction step. they plan to email this presentation to clients. the individual clients will be watching the presentation slide show on their own personal computers. what is the most important formatting step the company should take to make the text readable and pleasing to the eye?
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
[java] create an application called registrar that has the following classes: a. a student class that minimally stores the following data fields for a student: - name - student id number - number of credits - total grade points earned and this class should also be provides the following methods: - a constructor that initializes the name and id fields - a method that returns the student name field - a method that returns the student id field - methods to set and retrieve the total number of credits - methods to set and retrieve the total number of grade points earned. - a method that returns the gpa (grade points divided by credits) b. an instructor class that minimally stores the following data fields for an instructor: - name - faculty id number - department the following methods should be provided: - a constructor that initializes the name and id fields - methods to set and retrieve the instructor’s department. c. a course class that minimally stores the following data for a course: - name of the course- course registration code- maximum number of 35 students- instructor- number of students- students registered in the course (an array)the following methods should also be provided: - a constructor that initializes the name, registration code, and maximum number of students- methods to set and retrieve the instructor- a method to search for a student in the course; the search should be based on an id number.- a method to add a student to the course. if the course is hill, then an exception with an appropriate message should be raised (try creating your own exception class for this). also, be sure that the student is not already registered in the course. the list of students should be in the order that they registered.- a method to remove a student from the course. if the student is not found, then an exception with an appropriate message should be raised (use the same exception class mentioned a method that will allow course objects to be output to a file using object serialization- a method that will allow course objects to be read in from a file created with object serializationyou will note that the student and instructor classes described above have some commonality. create aperson class that captures this commonality and uses it as a base class for student and instructor. this class should be responsible for the name and id fields and also provide atostring method that returns a string of the form name, id. this will be the inheritedtostring method for the student and instructor classes.1. draw a uml diagram for diss application.2. implement the previous classes in java. write a main program that can serve as a test class that tests all of the methods created and demonstrates that they are working
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
Amitha writes up a one-page summary of a novel during her summer internship at a publishing company. when she reads over the page, she realizes she used the word “foreshadow” seven times, and she would like to reduce the repetition. which tool would best amitha solve this problem?
Answers: 3
question
Computers and Technology, 23.06.2019 23:30
Match the following errors with their definitions. a. #name b. #value c. #ref d. 1. when a formula produces output that is too lengthy to fit in the spreadsheet cell 2. when you enter an invalid cell reference in a formula 3. when you type text in cells that accept numeric data 4. when you type in a cell reference that doesn’t exist
Answers: 1
You know the right answer?
The purpose of this programming project is to demonstrate a significant culmination of most construc...
Questions
question
Mathematics, 21.01.2020 21:31
question
Geography, 21.01.2020 21:31
Questions on the website: 13722363