Question: Exercise 4 Write a method called mode that returns the most frequently occurring element of an array of integers. Assume the array has at least

Exercise 4 Write a method called mode that returns the most frequently occurring element of an array of integers. Assume the array has at least one element and that every element in the array has a value between 0 and 100 (inclusive). Break ties by choosing the lower value. For example, if the array passed contains the values [27, 15, 11, 15, and 27], your method should return 15. Hint: You may wish to look at the Tally program in your textbook (Chapter 7) to get an idea how to solve this problem. Extra Credit: Write a version of this method that does not rely on the values being between 0 and 100
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
