Question: JAVA Lab 1 3 A: Write the three static methods below inside of your driver class ( this is the class that contains your main

JAVA
Lab13A: Write the three static methods below inside of your driver class (this is the class that contains your main method):
min(): Receives an integer array as a parameter and returns an integer. This method traverses the array in the parameters and returns the smallest number in the array.
max(): Receives an integer array as a parameter and returns an integer. This method traverses the array in the parameters and returns the largest number in the array.
avg(): Receives an integer array as a parameter and returns a double. This method traverses the array in the parameters and returns the mean average of the numbers in the array.
Inside your main method, prompt the user for a size for the array you are about to create; keep prompting the user if they enter a size thats less than 1. Once the user enters a valid number, create an integer array of that size.
Next, prompt the user for enough numbers to fill the whole array. These numbers can be positive, negative, or 0.
Next, ask the user if they want to find the smallest, the largest, or the mean average of all the numbers theyve entered (keep prompting the user until they enter a valid choice). Pass the array to the appropriate method and print the results.
Keep asking the user for an option until they enter the option to quit.
You can assume that the user will not enter doubles or strings when prompted for a number.
Sample input on the next page.
Sample output (user input in bold):
How many numbers would you like to enter? -30
You must enter a value that is greater than 0.
How many numbers would you like to enter? 0
You must enter a value that is greater than 0.
How many numbers would you like to enter? 5
Enter number 0: 6
Enter number 1: -99
Enter number 2: 37
Enter number 3: 2000
Enter number 4: 81
1- Find the smallest of the numbers entered
2- Find the largest of the numbers entered
3- Find the average of the numbers entered
4- Quit
Enter your option: 1
The smallest of the numbers you entered is -99
1- Find the smallest of the numbers entered
2- Find the largest of the numbers entered
3- Find the average of the numbers entered
4- Quit
Enter your option: 2
The largest of the numbers you entered is 2000
1- Find the smallest of the numbers entered
2- Find the largest of the numbers entered
3- Find the average of the numbers entered
4- Quit
Enter your option: 3
The average of the numbers you entered is 405.0
1- Find the smallest of the numbers entered
2- Find the largest of the numbers entered
3- Find the average of the numbers entered
4- Quit
Enter your option: 5
That is not a valid option!
1- Find the smallest of the numbers entered
2- Find the largest of the numbers entered
3- Find the average of the numbers entered
4- Quit
Enter your option: 4
Shutting off...

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