hts.StevenWood.com

Exercise 4-3-1

Home ] Up ] [ Exercise 4-3-1 ] Exercise 4-3-2 ] Labs ] Quiz ][ Last Page ]

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.

  1. Add ONE more element to the length of each of the arrays in the following manner:
    1. To the initializer list for name add an element to the end of the list, this element is "Average".
    2. To the initializer list for EACH of the marks arrays, add an element to the end of the list, this element is 0.
  2. 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.
  3. In the main method call the markAverage method and place it's return value in mark1[4]. Place this line before the findAverages method.
  4. In the main method call the markAverage method and place it's return value in mark2[4]. Place this line before the findAverages method.
 

 

Home ] Up ] [ Exercise 4-3-1 ] Exercise 4-3-2 ] Labs ] Quiz ][Last Page]
All material on this site is copyright © 1997- by Steven Wood or as credited. All right reserved. Use of this site indicates you agreement with the  terms of use.
Send comments or questions to about this page.
Every attempt has been made to credit work under copyright. If there are any claims that copyright has been missed please contact the .
+SDG+