Input parameter and returns an integer value

Assignment Help Basic Computer Science
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.

Reference no: EM131400949

Questions Cloud

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 ..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What would constitute such evidence

Does that constitute evidence that Country X's trade practices are unfair? What would constitute such evidence?

  Role of the project portfolio manager

1. How do experienced project managers assign importance to each aspect of the triple constraint? 2. Describe the role of the project portfolio manager in relation to the roles of project manager and program manager.

  What is information storage

1) What is Information Storage and why is properly managing storage important? 2) Describe the difference between rotating storage media and flash media. Explain how companies might choose to utilize one over the other.

  Does rpf actually create a shortest path tree

We say that a router in DVMRP creates a shortest-path tree on demand. What is the meaning of this statement? What is the advantage of creating shortest path trees only on demand?

  What would the chromaticity diagram look like

Suppose instead that the domains overlapped so that red was defined on [500, 600], green on [450, 550], and blue on [400, 500]. What would the chromaticity diagram look like? How many primaries would be needed to faithfully reproduce every color p..

  Comparison-based sorting algorithm

1. Prove that any comparison-based sorting algorithm requires 0.(N log N) compar- isons on average.

  Define what is the meaning of snrdb

An analog signal has a bandwidth of 20 KHz. If we sample this signal and send it through a 30 Kbps channel, what is the SNRdB?

  Does every student have an equal chance of being selected

If it comes up heads, you use the 20 students sitting in the first two rows as your sample. If it comes up tails, you use the 20 students sitting in the last two rows as your sample. Does every student have an equal chance of being selected for th..

  Projects or ongoing operations

Briefly describe one or two of your current work assignments and determine whether they are projects or ongoing operations. Document your reasons for describing the assignment as a project or ongoing operation.

  How consider the un-pipelined processor

Consider the un-pipelined processor

  Flowchart that display the students average scores

Flowchart that display the students average scores for 3 quizzes - Display an appropriate error message and ask the user to re enter a value of 3 quizzes.

  Differentiate between microsoft office sharepoint server

Differentiate between Microsoft Office SharePoint Server 2007 for Internet sites and Microsoft Office SharePoint Server 2007.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd