Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

9. Power and politics can be destructive forces in organizations.

Answered: 1 week ago