Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Array Operations

julesxdujour
julesxdujour 


Write a program with an array that is initialized with test data, Use any primitive data type of your choice. The program should also have the following methods: getTotal. This method should accept a one-dimensional array as it argument and return the total of the values in the array getAverage. This method should accept a one-dimensional array as it argument and return the average of the values in the array. getHighest. This method should accept a one-dimensional array as its argument and return the highest value in the array. getLowest. This method should accept a one-dimensional array as its argument and return the lowest value in the array. Demonstrate each of the methods in the program. Attachments
Tags Clarifications

Answers

Array Operations - Java Project

dickersonka
dickersonka 



The array operations java eclipse... Attachments
ArrayOperations.zip (3 K) Download




Preview
* Gets average of all elements in array */ public double getAverage(int[] arr){ //Gets total of array int total = getTotal(arr); //Divide total by number of elements double average = (double)total / arr.length; return average; } /**

Preview
= new int[] { 50, 22, 3, -25, 15, 20, 101, 561, 340 }; //Create array operations class ArrayOperations arrayOps = new ArrayOperations(); //Print array total

Screenshots
Purchase Answer