subject

Write a method, including the method header, that will receive an array of integers and will return the average of all the integers. Be sure to use the return statement as the last statement in the method. A method that receives an array as a parameter should define the data type and the name of the array with brackets, but not indicate the size of the array in the parameter. A method that returns the average value should have double as the return type, and not void. For example: public static returnType methodName(dataType arrayName[]) 3 The array being passed as a parameter to the method will have 10 integer numbers, ranging from 1 to 50. The average, avgNum, should be both printed in the method, and then returned by the method. To print a double with 2 decimal points precision, so use the following code to format the output: System. out. printf("The average of all 10 numbers is %.2f\n", avgNum);

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:30
Some of the first computer games were created in the early 1970s by college students experimenting after hours to see what the were capable of doing.
Answers: 3
question
Computers and Technology, 23.06.2019 18:30
The computers in the sales department did not have enough data storage capacity to contain all the information the department needed to store, and it was taking a long time for team members to access the data they needed. to fix the problem, the technician installed new, larger hard drives on all the computers.
Answers: 1
question
Computers and Technology, 23.06.2019 18:50
Ais a picture icon that is a direct link to a file or folder
Answers: 1
question
Computers and Technology, 24.06.2019 07:30
Jason is working on a microsoft excel worksheet and he wants to create a print preview shortcut. his teacher asks him to access the customization option to create the new shortcut. which two tabs should jason select to place the print preview shortcut on the worksheet toolbar? a. new tab (custom) and new group (custom) b. new file tab (custom) and new tab (custom) c. new custom group and new command d. new custom tab and new command
Answers: 2
You know the right answer?
Write a method, including the method header, that will receive an array of integers and will return...
Questions
question
Mathematics, 15.12.2020 18:30
question
Health, 15.12.2020 18:30
question
Physics, 15.12.2020 18:30