Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 13 Weeks Ago, 1 Day 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
Question 1Â (10 points)
Write a method that computes the average of the values in an array of doubles.
The header of the method is as follows:
public static double average(double[] x)
Question 2Â (20 points)
Write a complete Java class that will create a 2D array of randomly generated ints with dimensions of 5 rows and 10 columns. Print the values of each cell to a 5x10 table.Â
(Note: a complete Java class means the code should compile and run without issue. Be sure the output displays a set of random ints formatted in 5 rows by 10 columns.
Question 3Â (5 points)
You have an int array named examScores that is 1000 elements in length.
Provide a single line of code that would sort the examScores. (Note: You do not need to provide the import statements supporting the line of code)
Question 4
You have an int array named examScore that is 100 elements in length.Â
Provide a single line of code that would search the examScores for values that
are 50.
(Note: You do not need to provide the import statements supporting the line of code)
Â
Question 5
Describe an application that would be a good choice for using 3D array.Â
Â
Provide the size of the array and the most likely data type. Provide the specific Java nested loop
you would use to populate the array elements with random values.