Question: Write an application that allows a user to enter any number of student test scores using that number to create a loop until the user

Write an application that allows a user to enter any number of student test scores using that number to create a loop until the user enters all the scores, DO NOT USE "QUIT" to stop entering scores. If the score entered is less than 0 or more than 100, display an appropriate message and do not use the score. After all the scores have been entered, display the number of scores entered, the highest score, the lowest score, and the arithmetic average. Save the file as TestScoreStatistics.java.

//DO NOT USE "QUIT" to stop entering scores.

//Instead, ask the user how many grades they are going to enter. Use this number to create a loop.

import java.util.*; public class TestScoreStatistics { public static void main (String args[]) { int score; int total = 0; int count = 0; int highest; int lowest; final int QUIT = 999; final int MIN = 0; final int MAX = 100; Scanner input = new Scanner(System.in);

System.out.print("How many scores would you like to enter >> ");

enterCount = input.nextInt(); System.out.print("Enter a score >> "); score = input.nextInt();

//Create a while statement that will loop for the amount entered while( ) { } System.out.print("Enter another score >> "); score = input.nextInt(); } System.out.println(count + " scores were entered"); System.out.println("Highest was " + highest); System.out.println("Lowest was " + lowest); System.out.println("Average was " + (total * 1.0 / count)); } } //Sample output

How many scores would you like to enter? >> 4

Enter a score >> 90 Enter another score >> 95 Enter another score >> 78 Enter another score >> 50 4 scores were entered Highest was 95 Lowest was 50 Average was 78.25

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 Databases Questions!