Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program that counts word occurrences in a given input file and outputs an HTML document with a table of the words and

image text in transcribed
Write a Java program that counts word occurrences in a given input file and outputs an HTML document with a table of the words and counts listed in alphabetical order. Here are some initial requirements: The program shall ask the user for the name of an input file and foe the name of an output file. The input file can be an arbitrary text file. No special requirements are imposed. The output shall be a single well-formed HTML file displaying the name of the input file in a heading followed by a table listing the words and their corresponding counts. The words should appear in alphabetical order. Words contain no whitespace characters. Beyond that, it is up to you to come up with a reasonable definition of what a word is and what characters (in addition to whitespace characters) are considered separators. In the first item above, "name of an input file" and "name of an output file" are to be understood as follows. Each includes the notion of a path to the terminal name. The path may either be relative to a current folder or be absolute from the top of the file system. It would be bad form for the program to insert an implied sub-path or folder prior to or after what the user supplies as input. Similarly, it would be bad form for the program to supply an implied filename extension such as ", txt" or " html" after what the user supplies as input. Therefore, the program shall respect the user input as being the complete relative or absolute path as the name of the input file, or the name of the output file, and will not augment the given path in any way. e.g., it w ill not supply its own filename extension. For example, a reasonable user response for the name of the input file could directly result in the String value "data/ gettysburg.txt": similarly, a reasonable user response for the name of the output file could directly result in the String value "data/gettysburg.html", These are the stated requirements for your program. If you have questions of clarification or need additional details, post them to Piazza. Setup You're on your own! There are no other setup instructions. As a reminder, instructions on how to set up Eclipse and to create a new project from the ProjectTemplate are available here, and instructions on how to create a zip archive in Eclipse are available here. Method When you are satisfied that your program works, select your Eclipse project (not just some of the files, but the whole project), create a zip archive of it, and submit the zip archive to the Carmen dropbox for this project, as described in Submitting a Project. Your grade will depend not merely on whether the final program meets the initial requirements, of course, but also on the general software quality factors you've learned in CSE 2221: understandability. precision, appropriate use of existing software components, maintainability, adherence to coding standards, and so forth. A sample input file is available at: gettysburg.txt A sample of the corresponding program output is available at: gettysburg.html

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions