Sum and average: Accumulate the sum in a loop and divide by length for the average.
How to apply it: Cast to double before dividing for a precise average: (double) sum / arr.length.
Course: AP Computer Science A · Unit: Array
Practice questions about Sum and average on AimFive — get rubric-based feedback showing exactly which points you earned.
AP and Advanced Placement are trademarks of College Board. AimFive is not affiliated with or endorsed by College Board.