Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the solution to this, please make sure code is ready to be copied. Thank you. The text version of this is below. public

What is the solution to this, please make sure code is ready to be copied. Thank you. The text version of this is below.

image text in transcribed

public class ArraysLabInt{

//maxElement returns the max value in the array arr

static int maxElement(int [] arr){ return 0; }

//averageVal returns the average of all the values

static double averageVal(double [] arr){ return 0.0; }

/*everyFourth returns an array arr but... each multiple of 4 is replaced by 1111*/static int [] everyFourth(int [] arr) { return arr; }

//populateGrades returns an array of doubles that represent 8 grades. //The user should be inputting these grades from the scanner //The user input should be done within the structure of the method, not within Mainstatic double [] populateGrades() { double [] arr = {}; return arr; }

Exercise 1: public class ArraysLablnt /maxElement returns the max value in the array arr static int maxElement(int ] arrX return 0; ) //averageVal returns the average of all the values static double averageVal(double [| arr) return 0.0; ) /*everyFourth returns an array arr but... each multiple of 4 is replaced by 1111* static int everyFourth (int ] arr) return arr; h /populateGrades returns an array of doubles that represent 8 grades. //The user should be inputting these grades from the scanner //The user input should be done within the structure of the method, not within Main static double I populate Grades() { double arr return arr; ) Exercise 1: Results Example Array arr - 1, 2, 8, 4, 3, 7, 4, 2 Max Element maxElement (arr) 8 Average Value averageVal(arr) - 3.875 Every Fourth everyFourth(arr) - Populate Grades Arr before populateGrades (arr) - t0, 0, 0, 0, e, 0, 0, 0 Arr after populateGrades (arr) - 190, 80, 55, 76, 82, 86, 93, 921

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Q) What are the engineering factors for nitration

Answered: 1 week ago