contestada

welcome to your final coding quiz. this quiz emphasizes your understanding of abstract classes. for this quiz, you will write the following files: abstractdatacalc averagedatacalc maximumdatacalc minimumdatacalc as you can expect, abstractdatacalc is an abstract class, that averagedatacalc, maximumdatacalc and minimumdatacalc all inherit. the following files are provided (click download) csvreader to help read csv files. dataset this file uses csvreader to read the data into a list> type structure. think of this as a matrix using arraylists. the important methods for you are rowcount() and getrow(int i) - between csvreader and dataset - all your data is loaded for you! main this contains a public static void string[] args. you are very free to completely change this main (and you should!). we don't test your main, but instead your methods directly. however, it will give you an idea of how the following output is generated. sample input / output given the following csv file 1,2,3,4,5,6,7 10,20,30,40,50,60 10.1,12.2,13.3,11.1,14.4,15.5 the output of the provided main is: dataset results (method: average) row 1: 4.0 row 2: 35.0 row 3: 12.8 dataset results (method: min) row 1: 1.0 row 2: 10.0 row 3: 10.1 dataset results (method: max) row 1: 7.0 row 2: 60.0 row 3: 15.5

Respuesta :

To create the abstract class AbstractDataCalc, you will need to define the abstract methods that will be implemented in the derived classes. These methods should include functions to calculate the average, minimum, and maximum of a row of data in the dataset.

For example, you might define the following abstract methods:

[ Refer first image for code ]

Next, you will need to create the derived classes AverageDataCalc, MaximumDataCalc, and MinimumDataCalc. These classes should inherit from AbstractDataCalc and implement the abstract methods defined in the parent class.

For example, in the AverageDataCalc class, you might implement the average() method like this:

[ Refer second image for code ]

You will need to implement similar logic for the min() and max() methods in the MinimumDataCalc and MaximumDataCalc classes, respectively.

Finally, you will need to modify the main() method to use these classes to calculate the average, minimum, and maximum of each row in the dataset. You can use the methods provided by the AbstractDataCalc class to do this.

For example, you might write the main() method like this:

[ Refer third image for code ]

This main() method creates instances of the AverageDataCalc, MaximumDataCalc, and MinimumDataCalc classes and uses them to calculate the average, minimum, and maximum values for each.

Learn more about abstract class:
https://brainly.com/question/29849218

#SPJ4

Ver imagen Qwseed
Ver imagen Qwseed
Ver imagen Qwseed
ACCESS MORE
ACCESS MORE
ACCESS MORE
ACCESS MORE