Image one is my file or you can create ur own file as long as it's similar to mine. image 2 is my program I want to write a 4th method(method 4) and the spec is: A method to count the occurrences of each value in an array takes one parameter, an array of integers returns an array containing the number of times each value occurs in the parameter array. Also should call method 3 from method 4 Hint: The general idea of this method is using an array with length maxVal+1(maxVal should get from method 3 already) to save the occurrences of each number. For example, if number 44 occurs 3 times in the file, your array should have a value 3 stored at index 44.
Image one is my file or you can create ur own file as long as it's similar to mine.
image 2 is my
I want to write a 4th method(method 4) and the spec is:
A method to count the occurrences of each value in an array
-
takes one parameter, an array of integers
-
returns an array containing the number of times each value occurs in the parameter array. Also should call method 3 from method 4
Hint:
The general idea of this method is using an array with length maxVal+1(maxVal should get from method 3 already) to save the occurrences of each number. For example, if number 44 occurs 3 times in the file, your array should have a value 3 stored at index 44.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images
Thank you!
base on these methods, I want to write one more method
Spec for method 5:
A method to print a text-based histogram
-
takes one parameter, an array of integers
-
no return value
image 2 is the example of expected output.
Hint: basically it means base on the file, if number 20 appears once in the file, then I will print one star(*) after the number 20. I think we can get these information from method 4
thank you. base on the
please provide a screenshot of ur program once it's finished.