Write a function void readarrayint arr int length to read


Write functions as given:

Question: 1 Write a function void readArray(int arr[], int length) to read in length many values into the array arr.

Question: 2 Write a function int getMaxPos(int arr[], int length) that calculates and returns the index of the maximum value in the first length positions of the array arr.

Write a main function that:

1. Has an array called data

2. Prompts the user for a size (guaranteed no more than 50)

3. Calls the function readArray to read data into the array

4. Calls the function getMaxPos to find the maximum in the array

Solve these questions in details and provide examples to support your rationale.

 

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write a function void readarrayint arr int length to read
Reference No:- TGS0954865

Expected delivery within 24 Hours