Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1) In the src/main/java directory, create a new java file called StatFormulas.java. This file will have one class defined in it: public class StatFormulas 2)
1) In the src/main/java directory, create a new java file called StatFormulas.java. This file will have one class defined in it: public class StatFormulas 2) Inside of the StatFormulas class you need to implement the following methods: public static double mean(double values[]) public static double median(double values[]) public static double std(double values[]). These are basic statistics formulas that are easily found if you are not familiar with them. You will use the Standard Deviation formula for population not sample. You will notice that your data is read into arrays of doubles. There are better data structures in Java but since we have not covered them yet, we will stick with arrays which everyone should be comfortable with. There are some helpful methods of the Java Array class if you choose to use them. For instances; you will notice this line in the constructor of the Statistics class: Arrays.parallelSort(values); This is a static method of the Array class that sorts an array. You will also find length helpful. How to develop this project: You will need to import this project, the HomeworkOne directory, as a Maven project in the IDE of your choice or just go to that directory from the command line. You can run the Maven commands: clean: removes all class files and reports. test-compile: compiles files in the src/test/java directory compile: compiles files in the src/main/java directory test: runs all test cases For each method you write, you should compile your project and run the tests. If the method is correct, you will pass the two tests for that method (run with the values from the text files)
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