Question: IN JAVA This week I want you to write a program that calculates and displays two of the three most common points of central tendency

IN JAVA
This week I want you to write a program that calculates and displays two of the three most common "points of central tendency" for an array of integers. Start you program by adding the following line in your main() method to create and initialize an array of 21 elements each containing the number of tamales consumed by each of the 21 guests at a party. For your convenience this array is already in order. Then calculate the two values for this array and display them. Do not just solve the problem for this one example array, your solution should continue to work even if you alter the data in the array or the number of elements in the array. i.e. After the next party should be able to give new numbers for the 36 guests that showed up to that party and your program should still be accurate with me only changing the array initialization line of code. int[] tamales Consumed = {0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 4, 5, 5, 5, 7}; 1. Mean: Display the mean number of tamales consumed by party guests. That is the sum of all of the tamales consumed by all the guests, divided by the number of guests. 2. Median: If the number of tamales eaten by each guest is placed in order (as it is) then the median is the number of tamales consumed by the middle most guest. For 7 guests it would be the number eaten by the 4th guest
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
