Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java question really need help thanks~~!! ------------------------------------------------------------------------------------------------ --------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------- here is the input text files for testing : base_case.txt: --------------------------------------------------------------- Assume one-or-more empty lines

Java question really need help thanks~~!!

image text in transcribed

------------------------------------------------------------------------------------------------image text in transcribed

---------------------------------------------------------------------------------------------

image text in transcribed

----------------------------------------------------------------------------------------------

image text in transcribed

-------------------------------------------------------------------------------------------------------

here is the input text files for testing :

base_case.txt:

image text in transcribed

---------------------------------------------------------------

Assume one-or-more empty lines separate paragraphs in a text file. This homework requires you to develop a Java program that accepts 2 command-line arguments (i.e., arguments to the main cihol 1. 2. The first command-line argument will be the path to the text file to be processed The second command-line argument will be a Boolean flag (true or false). If this flag is false then word counts should simply be printed as zero. If this flag is true then word count must be computed and printed The Java program must process line-by-line from the specified text file and Required base case |15 pointsl: Print the first and last line (if different) of a paragraph in a given HTML format. Note that if first and last line is identical (i.e., a paragraph has only 1 line) then print just the first line. This is the base case (or minimal) requirement to earn any score for this homework. Optional I5 points]: Print count of words in each paragraph, if the second command- line argument is true. If you don't implement this functionality then just 0 (zero) as word count. Optional |10 pointsl: Print count of valid English words in each paragraph, if the second command-line argument is true. If you don't implement this functionality then just 0 (zero) as word count. Quality of solution 15 pointsl: Quality includes - conciseness of solution, meaningful method names, appropriately named variables, effective code reuse, good comments, and avadoc documentation HTML output format Information about a paragraph is printed as rows in an HTML table. Each row has 2 columns. The first column has the first and last line. The second column has word counts. The row format is- First-line Last-lineWords:Dcount English words:Deng Where is l blank space Text in bold and HTML tags are to be printed verbatim .First_1ine and Last_line are the text for the 1st and last line for a given paragraph The count and eng are count of words and count of valid English words in the paragraph Sample inputs and outputs The command-line arguments to use are shown as part of the Java call below. In the output, each line is indented by 2 blank spaces. The HTML tags are highlighted just for visual convenience You should view base case.txt and us const amendments.txt in a text editor to understand their contents Base case Note that word count implementation is not necessary for base case. In addition, the 2"d command-line argument is false. Hence, word counts are zero java Homeworkl base case.txt false First and last 1ineWord counts/tr> This is the first line of first paragraph This is the last line of first
Second para line 1 Second para 11ne 2Words : English words: A one line third paragraphwords: 0 English words: paragraphk/td*td>words: 0 English words:/tdxtr> K/tdxtr> This paragraph is going to have 5 1ines. Line 1 of S This paragraph is going to have 5 lines. Line 5 of 5Words: English words 0 This is the last, 1line paragraph in this file.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions