Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java please only 8C don't make 8A and 8B tplaining what action(s) each perform, You trugt, comment the tuain progran and at mathods, esign a

java please
only 8C
don't make 8A and 8B
image text in transcribed
tplaining what action(s) each perform, You trugt, comment the tuain progran and at mathods, esign a lava class with a main method that reads, for a number of books, the length of the ngest and shortest sentence of each book. The number of books it not known but with not erceed 00. ample data to be read in: Explanation: there are three books, the first with a longest sentence of 25 and a shortest of 10u second book with longest sentence of 18 and shortest of 5 : and a third book wikh longest sentence of 14 and shortest of 2 . main will irvoke methods, that you write, to perform the following tasks: (a) main will pass a filename (for input) and array to a method readonta that win read from the file the book data (longest/shortest length). The method computes the average length of the two sentences and stores it in the array that was passed to the method. The method will return the total number of books read in. For example, given the above dato, after readpata is finished executing, the array with contain: \begin{tabular}{|l|l|l|} \hline 15.0 & 11.5 & 18.0 \\ \hline \end{tabular} and it will return 3 (b) main will invoke a method aunarize that accepts an object of a class that will enable writing to a file (such as, for example PrintWriter or Printstream or whichever you prefer), for output, an array (of average sentence lengths) and the number of elements in the array- The method first computes the overall average sentence length of all books and prints it to the : output file. It then compares the overall average sentence length to the average sentence length of each book and writes to the nie the number of sentences whose length are more than the average. less than the average and equal to the average length. The method will retum the overall average sentence length. For example, given the above data, after compare finishes executing, the fle should contain: The overall avernge in 11.5 1 avarage was greater than the overall average 1 average vas egual to the overal1 average 1 average was less than the overal1 average (c) main will invoke a method dotad as that is passed the same object for printing to a file and array as in part (b) as well as the overall average sentence length and will write for each book: the average length of the two sentences and whether the average sentence length for that book. Is greater than, less than or equal to the overall average length. After executing this method, the file contains (output is cumulative from the previous step don' close the output file until all output has been written) The overal1 average is 11.5 1 average was greater than the overall average 1 average vas equal to the overall average 1 average vas less than the overal1 average 15,0 is greater than the overal1 average 11.5 in equal to the overall average 8.0 is 1 est than the overall average

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

Advances In Database Technology Edbt 88 International Conference On Extending Database Technology Venice Italy March 14 18 1988 Proceedings Lncs 303

Authors: Joachim W. Schmidt ,Stefano Ceri ,Michele Missikoff

1988th Edition

3540190740, 978-3540190745

More Books

Students also viewed these Databases questions

Question

6. How do histories influence the process of identity formation?

Answered: 1 week ago