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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started