Question: help in Java Eclipse CS1S3101_Assig Dibujar Diseo Disposicin Referencias correspondencia Assignment 6: Array This assignment asks you to write a collection of little functions that

 help in Java Eclipse CS1S3101_Assig Dibujar Diseo Disposicin Referencias correspondencia Assignment

6: Array This assignment asks you to write a collection of little

functions that all operate on an array of integers. All the fooxctions

help in Java Eclipse

CS1S3101_Assig Dibujar Diseo Disposicin Referencias correspondencia Assignment 6: Array This assignment asks you to write a collection of little functions that all operate on an array of integers. All the fooxctions take on array os argument 1. Create a function called SpArtavl) which creates a deep copy and copies every element from the first array to the second array and returns the second array 2. Create a function called void gointiterall that prints the array to the console in a form that looks exactly like the literal strings use above for initialization. The literal starts with a "f", then lists the numbers separated by commas but no spaces, and ending with y. The output must even work if the length of the array is 0 (-0') or 1 (no commas). 3. Create a function called sumofArray that returns the sum of the values in the array 4. Create a function called maxinary that returns the maximum value in the array. 5. Create a function called ministray that returns the minimum value in the array When looking for min or max, compare each new value to the min or max value that you have seen so far. Do not initialize that value to an arbitrary extreme (like O). Observe that when you check the first value of the array, that value should become the min or max you have seen so far, since you haven't seen anything else. Assuming that you are using a variable called missen the correct solution is to initialize min saen to the first value right away, before starting the loop. That way you don't have to know anything about the range of possible values which could be all negative, making 0 a bad choice for the initial value.) 6. Create a function called tankelbarrax, that returns the range of the values in the array. In math, the range is the magnitude of the difference between the minimum and maximum (inclusive) You compute it by subtracting the minimum from the maximum. You already have methods that return the min and max. Use them and do not include any loops in this method Create a function called mean that returns the average value in the array. Even though the array contains of return the average as a double. Note that you have a method for the sum and you can get the length by using the array property of the array itself. So this method only has to do a divide. Test that you can get a result that includes a fractional part (not just whole numbers). You may need to look up "cast" to see how to make the division not do an interer divide In the average and range functions, use the fray, Arax, and AUDAX functions to compute those parts, rather than repeating the work of computing the sum or looking for min and max Create a function called op that takes a maximum value as an argument besides the array and changes any value in the array that is higher than the specified maximum value to be the same as the maximum value. This function could also be called haircut" in that it takes values that are too high, and cuts them down to the maximum allowable height think of a scissor going through your hair and trimming the ones that are too long the tray 2,4,6,2,3, after clip) it should be {2,4,5,5,3). asDB Ingls Estados Unidos to search en Este PC Victor Gabriel Arriaga Cedeno Ha Ayuda O Buscar Compa When calling the dip) function from main(), use SORVALTXO to make a copy of the array and use the new array for clipping so that the original array is not touched. call the print function before and after to show the effect of clipping. Do not print values inside the clip method. Create a function called median which calculates the median of the array and returns the median value. Median is the middle number in the array after sorting the array. If array has odd number of elements, median is the exact middle number. If the array has even number of elements, median is the average of the two middle elements. For example if array has 9 elements, median is the 5" element or element corresponding to the 4 index. If array has 10 elements it's the average of the 5th and 6 element or same as average of the elements in the 49 and 5 index. To calculate the median we need to sort the array. A sorting algorithm is given below. 10. Create a function called mode which returns the mode value which is the most repeated value in the array. If there are more than one mode, just pick one of them. a. For example consider the array(1,2,3,2,3,2,4,2,5,2), mode is 2 as 2 is the most repeated number b. Consider the array {1,2,3,2,3,2,3,4,5). In this array there are 3 twos and 3 Threes. So mode is 2 and 3. But you can return either 2 or 3 (One of the modes). . Consider the array (20,9,8,7,6,5). In this array every value appears only once. So all values are mades. Just return one of them. of Array is empty, The min and max methods should just return For median and mode you need the sorted array (especially for the median you can sort the array using the command. laxatil.Accax.serti the antyy to be passed in Please do not hard code the array or length of the array. All these functions should work for any array as input When you are finished (or as far as you got before getting stuck) submit the zipped package with class, as always. This is how your main will look like. You will have to complete the test avection that tests the functions. public static void main(Strinell ) inte ) int llarria In 181 arri is filled in with le randon numbers between 0 and 50 Int llar2 + 4, 6, 8, 10, 12, 14, 16, 7, 6, 22. 8. 9. 15, 5, 2, 7, 8, 12, 2, , 14, 17, 19, 121 Sa lon (arre) Dublic static void Lint 7. For the array call all the 10 functions as per specifications. All the print statements must be inside this function and not inside the 18 functions you did for the array

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!