Menu

### (Solved) : Write Application Allows User Enter Number Student Quiz Scores Integers User Enters 99 Sco Q35586040

Write an application that allows a user to enter any number ofstudent quiz scores, as integers, until the user enters99. If the score entered is less than 0 or morethan 10, display Score must be between 10 and 0and do not use the score. After all the scores have been entered,display the number of valid scores entered, the highest score, thelowest score, and the arithmetic average.

Example: Input –

9127-44699

Expected output:

4

9

4

6.5

Score must be between 10 and 0

———————————————————–

This is the code I have but it is not 100% correct:

import java.util.*;

public class QuizScoreStatistics
{

public static void main (String args[])
{
Scanner in = new Scanner(System.in);
int score, count = 0, highest = 0, lowest = 10, average = 0;
while (true)
{
System.out.print(“Enter a score: “);
score = in.nextInt();
if (score == 99) break;
if (score >= 0 && score <= 10)
{
if (score > highest) highest = score;
if (score < lowest) lowest = score;
average ++;
count ++;
}
}
{
System.out.println(“number of valid scores = ” + count);
System.out.println(“highest score is ” + highest);
System.out.println(“lowest score is ” + lowest);
System.out.println(“average score is ” + (average/count));
}

{
System.out.println(“Highest score: ” + highest);
System.out.println(“Lowest score: ” + lowest);
System.out.println(“Average score: ” + (average/ count));
}
}

}