Introduction Welcome to your final coding quiz. This quiz emphasizes your understanding of abstract classes. For...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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 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 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 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. 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. 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. 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. 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. 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. 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 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 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 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
Expert Answer:
Related Book For
Business and Administrative Communication
ISBN: 978-0073403182
10th edition
Authors: Kitty o. locker, Donna s. kienzler
Posted Date:
Students also viewed these programming questions
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
In a 1994 study, 164 pregnant, HIV-positive women were randomly assigned to receive the drug AZT during pregnancy and 160 such women were randomly assigned to a control group that received a placebo....
-
Williams Company purchases 1.000 shares of American Express common stock at the market price of $81.34 on March 23, 2016. (The equity method does not apply in this situation.) Williams intends to...
-
Q1) What is the equilibrium price and equilibrium quantity ? If the actual price in the market were above the equilibrium price, what would drive the market toward the equilibrium? If the actual...
-
How can a plaintiff enforce a settlement agreement made by the defendant?
-
For a telephone survey, a marketing research group needs to contact at least 600 wives, 480 husbands, 400 single adult males, and 440 single adult females. It costs $3 to make a daytime call and...
-
Assume the following information: 360day U.S. interest rate = 4% 360day British interest rate = 5% 360day forward rate of British pound = $2.00/ Spot rate of British pound = $2.02/ Hampshire Co. has...
-
A company wants to build a website where user can register themselves and buy/renew health insurance policies. Also, they can process claims from a separate section on the website. Once logged in,...
-
An Obstacle to Operational Excellence: Employee Turnover To drive operational excellence, a company called Qaphelani developed Qaphelani Management System (QMS), which included the companys own...
-
After reading and discussing how important it is for auditors to gather evidence to back up client claims, you are now introduced to accounting services where it is unnecessary to verify management s...
-
In what ways can organizational design principles foster or hinder innovation, and what balance should be struck between structure and flexibility to promote creative problem-solving ?
-
The following data are available for Bramble Corporation. Sale of land $224400 Sale of equipment $129200 Issuance of common 140800 stock Purchase of 69200 equipment Payment of cash 120700 dividends...
-
How do structural factors contribute to social stratification, and what mechanisms perpetuate these divisions in post-industrial societies ?
-
What is an affiliate marketing in business and entrepreneur? Which affiliate marketing strategy do you think is the most effective? Why? 2) What are the advantages of an affiliate marketing strategy?...
-
1. Create a new Android Studio project with an emptyactivity. Complete the following in your set-up: - Name the project and be sure to include your name in thetitle. Make sure the selected language...
-
What is a make-or-buy decision?
-
In small teams, turn the following categories into specific report problems you could research for a business communication course. Write three possible report problems for each category. 1. Social...
-
Your company is in a prime vacation spot, and as personnel manager you get many letters from students asking about summer jobs. Company policy is to send everyone an application for employment, a...
-
In each of the following situations, how detailed should the applicant be? Why? 1. Ron Oliver has been steadily employed for the last six years while getting his college degree, but the jobs have...
-
Find the free-vibration response of the spring-mass system shown in Fig. 6.6 (a) for \(k_{1}=k, k_{2}=2 k, k_{3}=3 k, m_{1}=m, m_{2}=2 m\), and \(m_{3}=3 m\) corresponding to the initial conditions...
-
Find the free-vibration response of the tightly stretched string shown in Fig. 6.33 for \(m_{1}=2 m, m_{2}=m, m_{3}=3 m\), and \(l_{i}=l(i=1,2,3,4)\). Assume the initial conditions as...
-
Find the free-vibration response of the triple pendulum shown in Fig. 6.10 for \(l_{i}=l(i=1,2,3)\) and \(m_{i}=m(i=1,2,3)\) for the initial conditions \(\theta_{1}(0)=\theta_{2}(0)=0\),...
Study smarter with the SolutionInn App