Question: Use the given code in: ALL Programs must use good programming style ( indenting , variable naming ) Place the following Comment section at the

Use the given code in: ALL Programs must use good programming style (indenting, variable naming)
Place the following Comment section at the top of the program.
// Name: your name
??? Course: COP 2250
//Program Name: Word Frequency Counter
Program 1:
Must Compile
Incorrect results lose 12 points
Do not turn in code that has not been tested
Turn in 4 files
All steps from the Prelimary section
Modifications from the modification section work correctly
Quicksort method works correctly and is timed
Swap method works correctly
Questions from the question section are answered correctly
Why is $marque' counted but can't be found in the original file
What will make the bubblesort method more efficient?
TODO: Q3, Q4, Q5
Why is 'buildingsand' a counted word?
Why does the code break on bigger files?
Why does the sort time differ each time it was called?
Do this assignment in the order listed in the Modifications and Questions sections.
Specifically, add the quicksort method before doing the swap method then move on to the other steps.
WordFrequencyCounter.java
Preliminary
Create a new Eclipse project as follows:
Name your Eclipse project: WordFrequencrCounter
Name the package: com wordfrequencvcourter
Name the class: WordFrequencu Counter
Replace the java file Eclipse gives you with the given java file WordFrequencyCounter.java
This program reads the given following file (The US Constitution):
uncounted-file.txt
Copy the file uncounted-file txt to your Eclipse workspace. The directory name looks like:
. Xourname \eclipse-workspace \WordFrequencyCounter
This program reads from uncounted-file.txt and creates a word frequency count list sorted by count and then
alphabetical and performs timing on the bubblesort method. Change the code to do the following:
Modifications
Add a quicksort method and use it instead of the bubblesort method, do the same timing as bubblesort.
Create a method that performs the swap and replace the appropriate code in the bubblesort with it
Use another text file
3.1. Download a different text file from the internet (make sure it's not much bigger than the given file)
3.2. Run this code on it.
3.3. Copy the console output to another file to turn in.
Questions
Create another text file to answer the following:
"marque" has a count of 2 yet doesn't appear in the original file, why?
how can the bubblesort method be optimized? Think of how many times each line in the loop is executed.
what does the line in the code TODO: Q3 do?
what does the line in the code TODO: Q4 do?
Why can't MAX_WORDS be used instead of currentWordCount at Q5?
why is "buildingsand" a counted word yet doesn't appear in the original file? How can this be fixed?
why will this code break on a file with twice as many words?
why did the bubblesort method take a different amount of time each time it was called?
Modifications to the code, such as "1 Add a quicksort method..." are marked like M1
Questions are marked in the code with a TODO: with the question number such as: Q1
Turn in:
Turn in the following files:
Updated java file
Text file you downloaded from 3.1
A text file with the console output from 3.3
A text file with the answers (including the question and its number) to the questions in 4
Don't turn in a zip file, just turn in the 4 files.
Uncounted file
Preamble: We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our posterity, do ordain and establish this Constitution for the United States of America.
Article. I.
Section 1.
All legislative Powers herein granted shall be vested in a Congress of the United States, which shall consist of a Senate and House of Representatives.
Section. 2.
Clause 1: The House of Representatives shall be composed of Members chosen every second Year by the People of the several States, and the Electors in each State shall have the Qualifications requisite for Electors of the most numerous Branch of the State Legislature.
Clause 2: No Person shall be a Representative who shall not have attained to the Age of twenty five Years, and been seven Years a Citizen of the United States, and who shall not, when elected, be an Inhabitant of that State in which he shall be chosen.
Clause 3: Representatives and direct Taxes shall be apportioned among the several States which may be included within this Union, according to their respective Numbers, which shall be determined by adding to the whole Number of free Persons, including those bound to Service for a Term of Years, and excluding Indians not taxed, three fifths of all other Persons. (See Note 2) The actual enumeration shall be made within three Years after the first Meeting of the Congress of the United States, and within every subsequent Term of t
 Use the given code in: ALL Programs must use good programming

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!