Question: ( JAVA ) COSC 1 4 3 6 : Arrays, Methods and File Manipulation INSTRUCTIONS: Write a program called Lab 0 9 . java. For
JAVA COSC : Arrays, Methods and File Manipulation
INSTRUCTIONS: Write a program called Labjava. For this lab you will need to read numbers.txt again but this time you will store the values from the file into an array of ints.
Once you read the file numbers.txt and store each number in each index of the array, you will have to use methods to perform specific tasks.
METHODS: In the same program file, write the following methods make sure you provide the javaDoc for each method to obtain full credit:
getSum: this method will take an array of ints as parameter and it will return the total sum of the numbers in that array.
getAVG: this method will take an array of ints as parameter and it will return the average of the numbers in in that array.
getMax: this method will take an array of ints as parameter and it will return the largest value of the numbers in the array.
getMin: this method will take an array of ints as parameter and it will return the smallest value of the numbers in the array.
getStdDev: this method will take an array of ints as parameter and it will return the standard deviation of the array
writeToFile: this method will take parameters. fileName: name of the file you want to report results. array: an array of ints representing the array containing the numbers of the input file This method will call other methods in order to create a file reporting the sum, average, largest, smallest and the standard deviation.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
