|
| |
Exercise 4-3-1
Working with related arrays.
This exercise is to be completed in class or for homework.
Using the Init4Arrays.java file as a base, add these items to complete the
project.
- Add ONE more element to the length of each of the arrays in the following
manner:
- To the initializer list for name add an element to the end of the
list, this element is "Average".
- To the initializer list for EACH of the marks arrays, add an element to the
end of the list, this element is 0.
- Create a method named markAverage. This is an integer type method
that receives an integer array and returns the average of the marks in the
array. Note that the last element (the zero) should not be included in the
average calculation.
- In the main method call the markAverage method and place it's return value
in mark1[4]. Place this line before the findAverages method.
- In the main method call the markAverage method and place it's return value
in mark2[4]. Place this line before the findAverages method.
|