I am creating a program to average grades from an array. As you can see, I can load the array properly but now I need to send the info to a method and then have it dispense the name of the student (stored in one array) and the average grade of each student (taken from the data from another array). Any help would be amazing!
Then in the for loop that starts at line 35. You could initialize an integer or double primitive (depending on whether to display decimal places) so line 36 could be replaced with:
So for each student the grade average variable would be reset then as you get iterate through the inner loop you total up the grades then you could have at the end of the inner loop (after the enclosing curly brace) which totals the grades the following:
The above is a hard-coded length but I'm sure you can get this length from one of the arrays. Depending on the displaying decimal places you could use a primitive double or integer. And then use a formater to determine the maximum number of decimals to display if you are displaying decimal places.
please buy my thing and then I'll have more money: