Question: 1. Design and implement a method numberFreq() that takes no parameters. The method reads an arbitrary number of integers that are in the range 0

1. Design and implement a method numberFreq() that takes no parameters. The method reads an arbitrary number of integers that are in the range 0 to 20 inclusive and counts how many occurrences of each are entered. The method employs an array to store the frequencies and returns this array.

2. Write a method bigEven () that takes two parameters: an integer array, numberArr, and an integer, target. The method returns the number of integers in the array that are even and bigger than target.

3. Write a method oddDice() that takes an array of Die objects as a parameter. The method rolls each die and returns the total number of dice that land in an even face value.

4. Embed the methods 1-3 in an application, TestArrays. The application invokes each method using simple test cases and displays the results. For example, invoke method bigEven() using an array containing integers: 2, 7, 8, 3, 4, 10 and a target 4 and print the result value (2).

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 Programming Questions!