Reference no: EM131400949
MethodsArrays
Write a Java program, called MethodsArrays that has 4 static methods called fillArray(), sumArray(), avgArray(), and printArray(). The fillArray() method should be called from the main method. The fillArray() method should use a Scanner to take in a number representing the length of the array and then read in numbers to fill the array.
The sumArray() method should take an int array as its input parameter and returns an integer value that is the sum of all the elements in the array.
The avgArray() method should take an int array as its input parameter and returns an integer value that is the average of all the elements in the array.
The printArray() method should take an int array as its input parameter and has no return value. It should then print out the elements of the array on the same line separated by a space (" "). All methods should work for integer arrays.
Input
n, where n is the length of the array, followed by m numbers
Sample input
3 2 3 4
Output
The program should print to the screen the sum of all the elements in the array, and the average of all the elements in the array followed by the array elements printed to the screen separated by a space.
Sample output
Sum = 9
Average = 3
2 3 4
Note: The Message for sum is: "Sum = " and the message for average is: "Average = "
In your code these should match EXACTLY to pass all test cases.
Explain the role of the nurse administrator
: Explain the role of the nurse administrator as an advanced practice role in nursing.Gather information from current literature, and/or the American Organization of Nurse Executive Competencies, and/or the American Nurses Credentialing Center and ..
|
Impact of cloud computing to data storage
: Write a report on the impact of cloud computing to data storage highlighting its advantages and disadvantages. The report should be APA style and should not exceed 2000 words
|
Which arguments of different perspectives can be created
: Identify a topic of interest for which arguments of different perspectives can be created. Construct one original descriptive argument and one original prescriptive argument for the topic you select.
|
What type of association would be suggested by large values
: What type of association would be suggested by large values of (c, e, g)?- What type of association would be suggested by large values of (a, e, i)?
|
Input parameter and returns an integer value
: The sumArray() method should take an int array as its input parameter and returns an integer value that is the sum of all the elements in the array.
|
Methods for accessing a remote computer
: Write a 200- to 300-word response that discusses the reasons and methods for accessing a remote computer. Must be original, with thought given.
|
Rationale for choosing the specific firewall in question
: Discuss your rationale for choosing the specific firewall in question, and determine the primary way in which a company could incorporate it into an enterprise network in order to enhance security. Select the two (2) most important and / or unique..
|
Explain online tools for business collaboration
: Create an online meeting presentation to evaluate online tools for business collaboration. Create a 10- to 15-slide presentation using a presentation tool. Design the presentation to be used in an online collaboration setting with a group of three..
|
What you plan to do to improve quality in current position
: Quality is an overriding principle in the AACN BSN Essentials document. Essential II specifically describes the role of the baccalaureate nurse in quality improvement. As you complete this course, reflect on how you will implement lessons learned ..
|