Question
**NO arrays are allowed, still have to use the basics** Develop a Java program that can perform the data analysis and determine the drug's effectiveness.
**NO arrays are allowed, still have to use the basics**
Develop a Java program that can perform the data analysis and determine the drug's effectiveness.
Each trial consists of 3 groups of individuals undergoing a different treatment:Control Group - No treatment; Experimental Group - New Drug Administered; Placebo Group - Fake Drug (sugar pills) Administered.
Every individual in each group gets the same memory evaluation, and the doctor will write down a score for that individual as a number between 0 and 100. There are many patients in each group, so some simple statistics are necessary to determine the effectiveness of the treatment.
Each TrialGroup object will store the important information for one trial group:
the name of the file containing the group data (fileName),
the number of data points in that file (count),
the sum of the values in that file (sum),
and the sum of the squares of the values in that file (sumOfSquares).
These stored values will be used to calculate the average, and the standard deviation for the group.
The TrialGroup object will also have methods to determine and return: the average of the values in the group (getAverage), the standard deviation of the values in the group (getStandardDeviation), and the name of the file that the values came from (getFileName).
The constructor for this class must initialize a TrialGroup object by:
Storing the file name that is passed in as an argument, in the instance variable fileName.
Opening the file whose name is passed in as an argument (fileName)
Reading in the values in the file and determining the count, sum, and sum of the squares for the values in the file.
Storing these values in the instance variables (count, sum, sumOfSquares)
The getFileName method will simply return a copy of the string stored in the instance variable fileName.
The getAverage method will compute and return the average of the values in this trial group.
The getStandardDeviation method will compute and return the standard deviation of the values in this trial group.
Here is one way to determine the standard deviation of a set of numbers
Given the following values:
count - How many numbers are in the set
sum - The sum of the numbers in the set
sumOfSquares - The sum of the squares (n * n) of each number (n) in the set
You can compute the standard deviation like this: First compute the average (sum / count), Next compute the squareOfAverage (average * average), Then compute the averageOfSquares (sumOfSquares / count) and finally compute the standard deviation: sqrt(averageOfSquares - squareOfAverage)
You may add any attributes (variables) or operations (methods) that you wish to the TrialGroup class. However, you may not delete or change the details of any of the attributes and operations in the given class diagram above.
We are given 3 test data files that will be called TrialData01.dat, TrialData02.dat and TrialData03.dat
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started