Question: /**** Consider the TestScores program below. * TestScores.java * Dean & Dean * This implements an algorithm that averages test scores. import java.util.Scanner; public

/**** Consider the TestScores program below. * TestScores.java * Dean & Dean

* This implements an algorithm that averages test scores. import java.util.Scanner; public

/**** Consider the TestScores program below. * TestScores.java * Dean & Dean * This implements an algorithm that averages test scores. import java.util.Scanner; public class TestScores [ public static void main(String[] args) [ Scanner stdin = new Scanner(System.in); int score; int scoreSum = 0; int count = 0; double average = 0; System.out.print("Enter score (-1 to quit): "); score = stdin.nextInt(); while (score >= 0) [ Activate Go to Sett scoreSum + score: count++; average (double) scoreSum / count: = System.out.print ("Enter score (-1 to quit): "); score stdin.nextInt(); System.out.println("Average score is " + average); } // end main } // end Test Scores class In the above program, note how the following lines appear above the loop and also at the bottom of the loop: System.out.print("Enter score (-1 to quit): "); score stdin.nextInt(); Modify the program so it avoids having those lines appear twice but keeps the same functionality. For your modification, you are required to use a boolean variable named done in the while loop's condition. 10. [afte Act Got

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!