Question: Introduction Welcome to your final coding quiz. This quiz emphasizes your understanding of abstract classes. For this quiz, you will write the following files:

Introduction Welcome to your final coding quiz. This quiz emphasizes your understandingof abstract classes. For this quiz, you will write the following files:AbstractDataCalc AverageDataCalc MaximumDataCalc MinimumDataCalc As you can expect, AbstractDataCalc is an abstractclass, that AverageDataCalc, MaximumDataCalc and MinimumDataCalc all inherit. The following files are

Introduction 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 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 Note: the extra line between Set results is optional and not graded. All other spacing must be exact! Specifications You will need to implement the following methods at a minimum. You are free to add additional methods. AbstractDataCalc public AbstractDataCalc (DataSet set) - Your constructor that sets your dataset to an instance variable, and runCalculations () based on the dataset if the passed in set is not null. (hint: call setAndRun) public void setAndRun (DataSet set) - sets the DataSet to an instance variable, and if the passed in value is not null, runCalculations on that data private void runCalculations () - as this is private, technically it is optional, but you are going to want it (as compared to putting it all in setAndRun). This builds an array (or list) of doubles, with an item for each row in the dataset. The item is the result returned from calcLine. public String toString() - Override toString, so it generates the format seen above. Method is the type returned from get type, row counting is the more human readable - starting at 1, instead of 0. public abstract String getType() - see below public abstract double calcLine (List line) - see below AverageDataCalc Extends AbstractDataCalc. Will implement the required constructor and abstract methods only. public abstract String getType() - The type returned is "AVERAGE" public abstract double calcLine(List line) - runs through all items in the line and returns the average value (sum / count). MaximumDataCalc Extends AbstractDataCalc. Will implement the required constructor and abstract methods only. public abstract String getType() - The type returned is "MAX" public abstract double calcLine(List line) - runs through all items, returning the largest item in the list. MaximumDataCalc Extends AbstractDataCalc. Will implement the required constructor and abstract methods only. public abstract String getType() - The type returned is "MAX" public abstract double calcLine(List line) - runs through all items, returning the largest item in the list. MinimumDataCalc Extends AbstractDataCalc. Will implement the required constructor and abstract methods only. public abstract String getType() - The type returned is "MIN" public abstract double calcLine(List line) - runs through all items, returning the smallest item in the list. Make sure you have run multiple tests (hint: try building your own sample files, run calculations by hand to make sure it is working right). We have given you 2 submission attempts (no delay required) in case there are errors in transferring the files, SDK issues etc. You should strive to get it correct on the first submission! IMPORTANT: Make sure you are not importing any unusual libraries into your files. 376560.2171954.qx3zqy7

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 Programming Questions!