Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 12 Weeks Ago, 3 Days Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Write a program (ArrayDemo.java) that prompts the user to enter 5 integer numbers. Once the user enters the 5 numbers, the program must determine and output the average, the largest, and smallest of 5 numbers.
Use the Scanner class as shown in the video of the Arrays module to read user input from the terminal window.
You must define the methods listed below in your program.  Make sure to keep the keyword "static" when you define the methods (we will learn later what static means). Call these methods from the "main" to get the job done.
Â
static float getAverage(int[] data)
Â
 {
// put your implementation here
}
static int getLargest(int[] data)
Â
 {
// put your implementation here
}
static int getSmallest(int[] data)
{
// put your implementation here
}Â
-----------