Question: 2) Write necessary statements in main() function to either allow users to enter a collection of non-negative integers or let the program randomly generate


2) Write necessary statements in main() function to either allow users toenter a collection of non-negative integers or let the program randomly generate

2) Write necessary statements in main() function to either allow users to enter a collection of non-negative integers or let the program randomly generate non-negative integers, display them, and find the median. Here are some examples when running the Homework 4 project. Select from: 1. Read Array 2. Generate Array 3. Print Array 4. Median 0. Quit 1 Enter elements (negative to end): 4 1 5 8 2 9 8 7 -1 Select from: 1. Read Array 2. Generate Array 3. Print Array 4. Median 0. Quit 3 4 1 5 8 2987 Select from: 1. Read Array 2. Generate Array 3. Print Array 4. Median 0. Quit 0. Quit 4 Median: 5 Select from: 1. Read Array 2. Generate Array 3. Print Array 4. Median 0. Quit 2 Select from: 1. Read Array 2. Generate Array 3. Print Array 4. Median 0. Quit 3 13 14 2 8 14 12 0 11 5 Select from: 1. Read Array 2. Generate Array 3. Print Array 4. Median 0. Quit 4 Median: 11 Select from: 1. Read Array 2. Generate Array 3. Print Array 4. Median 0. Quit 0 Thanks for using my program.

Step by Step Solution

3.49 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import javautilArrays import javautilScanner public class Homework4 public sta... View full answer

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!