Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using java programming language Project: Arrays and Methods Problem Description: In this program you will create an array, fill it with random integers, and then
using java programming language
Project: Arrays and Methods Problem Description: In this program you will create an array, fill it with random integers, and then do some investigating on the array's statistics. I want you to create two methods. One method should create an int array of size 100 and fill it with random integers. The other method should actually investigate the array contents. A more thorough description is given below. Method 1: createArray Write a method that creates an integer array of size 100. Once created, use some type of loop to fill the array with random integers. Make sure these integers are in the range [0-99]. This method should accept no parameters and return an integer array. Therefore, the method header should look as follows: public static int[] createArray ( ) Method 2: statsDisplay Write a method that performs some rudimentary statistics on the recently created array. The statistics to take are as follows: Count and display the amount of even numbers (Note: You do not have to print the actual numbers). Count and display the amount of odd numbers (Note: You do not have to print the actual numbers). Calculate and display the average. This method should accept as input an int array. Since we are doing some simple printing, and do not actually need to return any values, use the void return type. Therefore, the header should look as follows: public static void statsDisplay (int[] intArray) Count and display the amount of even numbers (Note: You do not have to print the actual numbers). Count and display the amount of odd numbers (Note: You do not have to print the actual numbers). Calculate and display the average. This method should accept as input an int array. Since we are doing some simple printing, and do not actually need to return any values, use the void return type. Therefore, the header should look as follows: public static void statsDisplay (int[] intArray) Hints: Use the Math.random() as the base call to generate your random integers between 0-99. Use the remainder(modulus) operator to distinguish whether an integer is even or odd. Since the array is of size 100, use loops to fill the array and perform the statistics 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