CSE20 : Project #2 solution

$24.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (3 votes)

Create a new class called DataAnalyze (DataAnalyze.java) to do all your work. You may work in pairs or by yourself. The expectation is that you work on the project outside of lab time but you may certainly use any extra time in lab this week. Your partner can be in any section, All of you will make your own submission while noting your collaborator/partner in the text box of the submission. We have included sample runs to give you a better idea of how the program works given the project requirements. Refer to your previous lab assignments for hints on how to approach this project. You can ask the TAs or the instructor for clarifications and help. This project is worth 100 points so be sure to complete it. Submit DataAnalyze.java for this project in the assignment page after properly formatting it with instructions below on how-to inside Eclipse.
Problem:
For this assignment, you have been asked to write a computer program to automatically analyze some of the data collected by some experiments. Data analysis in scientific research is a complicated endeavor, so we will simplify our task by just calculating average, minimum and maxium for the collected data. There are four trials ran with many different data points for each trial. You need to write a program which does the following: Get the sample size For each of the 4 trials reads in the data for each sample and stores them in an array (per trial) Print out data per sample in a table format System.out.println(“\tSample #\tTrial 1\tTrial 2\tTrial 3\tTrial 4”); // Table header line \t means tab character, which is used to align columns Print out the average for each case
Figure out how closely the trials match with each other by comparing the averages using min and max Matching min and max means the trials match exactly – The trials match EXACTLY! The trials concur with each other if the max is less than twice the min – The trials concur with each other! Otherwise the differential between the trials is too high and they do not concur with each other – The trials do not concur! Before you submit, do ctrl-a (to select everything) and ctrl-i (to fix the indentation on DataAnalyze.java Sample Output: Please enter the sample size: 1 Enter numbers for Trial 0 Enter sample #0:5 Enter numbers for Trial 1 Enter sample #0:4 Enter numbers for Trial 2 Enter sample #0:4 Enter numbers for Trial 3 Enter sample #0:3 Sample # Trial 1 Trial 2 Trial 3 Trial 4 0 5 4 4 3 —————————————————— Average: 5 4 4 3 Min Average: 3 Max Average: 5 The trials concur with each other!
Please enter the sample size: 1 Enter numbers for Trial 0 Enter sample #0:5 Enter numbers for Trial 1 Enter sample #0:4 Enter numbers for Trial 2 Enter sample #0:3 Enter numbers for Trial 3 Enter sample #0:2
Sample # Trial 1 Trial 2 Trial 3 Trial 4 0 5 4 3 2 —————————————————— Average: 5 4 3 2 Min Average: 2 Max Average: 5 The trials do NOT concur!
Please enter the sample size: 1 Enter numbers for Trial 0 Enter sample #0:5 Enter numbers for Trial 1 Enter sample #0:5 Enter numbers for Trial 2 Enter sample #0:5 Enter numbers for Trial 3 Enter sample #0:5 Sample # Trial 1 Trial 2 Trial 3 Trial 4 0 5 5 5 5 ——————————————————- Average: 5 5 5 5 Min Average: 5 Max Average: 5 The trials match EXACTLY!
Please enter the sample size: 2 Enter numbers for Trial 0 Enter sample #0:5 Enter sample #1:-5 Enter numbers for Trial 1 Enter sample #0:-4 Enter sample #1:4 Enter numbers for Trial 2 Enter sample #0:3 Enter sample #1:-3 Enter numbers for Trial 3 Enter sample #0:2 Enter sample #1:-2 Sample # Trial 1 Trial 2 Trial 3 Trial 4 0 5 -4 3 2 1 -5 4 -3 -2 ——————————————————- Average: 0 0 0 0
Min Average: 0 Max Average: 0 The trials match EXACTLY!
Please enter the sample size: 3 Enter numbers for Trial 0 Enter sample #0:50 Enter sample #1:49 Enter sample #2:51 Enter numbers for Trial 1 Enter sample #0:30 Enter sample #1:31 Enter sample #2:32 Enter numbers for Trial 2 Enter sample #0:25 Enter sample #1:26 Enter sample #2:27 Enter numbers for Trial 3 Enter sample #0:15 Enter sample #1:16 Enter sample #2:17 Sample # Trial 1 Trial 2 Trial 3 Trial 4 0 50 30 25 15 1 49 31 26 16 2 51 32 27 17 ——————————————————- Average: 50 31 26 16 Min Average: 16 Max Average: 50 The trials do NOT concur!
Please enter the sample size: 10 Enter numbers for Trial 0 Enter sample #0:50 Enter sample #1:51 Enter sample #2:52 Enter sample #3:53 Enter sample #4:54 Enter sample #5:55 Enter sample #6:-2 Enter sample #7:-5 Enter sample #8:-10 Enter sample #9:112 Enter numbers for Trial 1 Enter sample #0:45 Enter sample #1:43 Enter sample #2:46 Enter sample #3:42
Enter sample #4:47 Enter sample #5:-1 Enter sample #6:-4 Enter sample #7:-10 Enter sample #8:43 Enter sample #9:159 Enter numbers for Trial 2 Enter sample #0:135 Enter sample #1:36 Enter sample #2:32 Enter sample #3:34 Enter sample #4:-4 Enter sample #5:34 Enter sample #6:-34 Enter sample #7:45 Enter sample #8:-45 Enter sample #9:177 Enter numbers for Trial 3 Enter sample #0:110 Enter sample #1:19 Enter sample #2:18 Enter sample #3:17 Enter sample #4:16 Enter sample #5:15 Enter sample #6:14 Enter sample #7:13 Enter sample #8:12 Enter sample #9:176 Sample # Trial 1 Trial 2 Trial 3 Trial 4 0 50 45 135 110 1 51 43 36 19 2 52 46 32 18 3 53 42 34 17 4 54 47 -4 16 5 55 -1 34 15 6 -2 -4 -34 14 7 -5 -10 45 13 8 -10 43 -45 12 9 112 159 177 176 ——————————————————- Average: 41 41 41 41 Min Average: 41 Max Average: 41 The trials match EXACTLY!