Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a program called Average.java that will compute theaverage of exam scores

ID: 3615841 • Letter: C

Question

Create a program called Average.java that will compute theaverage of exam scores to be input by the user. The user shouldenter zero or more exam scores; a negative number will indicate theend of input. Your program should output the number of exam scoresentered and the average score of the exams Sample run: Please enter exam score (enter a negative number to endinput): 100 Please enter exam score (enter a negative number to endinput): 70 Please enter exam score (enter a negative number to endinput): 50 Please enter exam score (enter a negative number to endinput): 20 Please enter exam score (enter a negative number to endinput): -1 The average score of 4 exams is 60.0. Create a program called Average.java that will compute theaverage of exam scores to be input by the user. The user shouldenter zero or more exam scores; a negative number will indicate theend of input. Your program should output the number of exam scoresentered and the average score of the exams Sample run: Please enter exam score (enter a negative number to endinput): 100 Please enter exam score (enter a negative number to endinput): 70 Please enter exam score (enter a negative number to endinput): 50 Please enter exam score (enter a negative number to endinput): 20 Please enter exam score (enter a negative number to endinput): -1 The average score of 4 exams is 60.0.

Explanation / Answer

please rate - thanks import java.io.*; public class untitled {     public static void main(String[] args) throwsException     {       BufferedReader keyIn = newBufferedReader(new InputStreamReader(System.in));       int grade,total=0,count=0;        double average;        String input;             System.out.print("Pleaseenter exam score (enter a negative number to end input): ");       input= keyIn.readLine();        grade=Integer.parseInt(input);        while(grade>=0)            {total+=grade;              count++;              System.out.print("Please enter exam score (enter a negative numberto end input): ");            input=keyIn.readLine();            grade=Integer.parseInt(input);           }        average=(double)total/count;       System.out.println("The averagescore of "+count+" exams is "+average);     } }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote