Mar 17, 2025
double sum: To keep track of the total sum of scores.int numStudents: To count the number of scores entered.Scanner keyboard: To read user input.double next: To hold the next entered score.sum, numStudents, and next to zero.sum.numStudents for each score.next >= 0.sum by numStudents.sum and numStudents for each new class.do-while loop to handle multiple class computations.equalsIgnoreCase to handle different cases for "yes" input.numStudents is not zero before computing average.break and continue excessively as it can lead to complex and hard-to-maintain code.