More practice using Arrays For this exercise, you need to complete all the questions in a single pro

More practice using Arrays
For this exercise, you need to complete all the questions in a single project. You will invoke the methods from your main. You will also copy the problem specifications above each method.

1. Write a method with the following specifications:
name: GenerateRandomArray
arguments: an int representing the size of the array
return value: an int array
displays: nothing
tasks: creates a Random object, allocate enough storage for the array, using a suitable loop, assign a random number from 10 to 20 to each spot in the array
Call this method from your main.
2. Write a method with the following specifications:
name: DisplayIntArray
arguments: an int array
return value: none
tasks: displays all the items in the array on a single line separated by a space
In your main, figure out how to display the output of the previous method
3. Write a method with the following specifications:
name: AverageIntArray
arguments: an int array
return value: double representing the arithmetic average of all the elements
displays: nothing
tasks: sums all the items and then divide by the size and return this value
In your main write the code that will exercise this method.
4. Write a method with the following specifications:
name: AssignBonus
arguments: int representing the bonus and an int array representing the marks
return value: nothing
displays: nothing
tasks: adds the bonus to each element of the array.
In your main you will call this method and then display the items afterwards. You should see each item increased by the amount specified by your bonus.

 

Looking for a Similar Assignment? Hire our Top Uk Tutors while you enjoy your free time! All papers are written from scratch and are 100% Original. Try us today! Active Discount Code FREE15