1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kvasek [131]
4 years ago
13

Write a program to read a list of exam scores given as integer percentages in the range 0-100. Display the total number of grade

s in each letter grade defined as follows:
90-100 is an A, 80-89 is a B, 70-79 is a C, 60-69 is a D, 0-59 is an F. Use a negative score as a sentinel to indicate the end of the input. (The negative value is used just to end the loop, do not use it in the calculations). Then output the highest and lowest score, and the average score.

For example if the input is: 72 98 87 50 70 86 85 78 73 72 72 66 63 85 -1

the output would be:

Total number of grades = 14

Number of As =1

Number of Bs = 4

Number of Cs = 6

Number of Ds = 2

Number of Fs = 1

The highest score is 98

The lowest score is 50

The average is 75.5
Computers and Technology
1 answer:
Tju [1.3M]4 years ago
3 0

Answer:

import java.util.Scanner;

public class Program

{

  public static void main(String [] Args)

  {

      int totalAGrades = 0, totalBGrades = 0, totalCGrades = 0, totalDGrades = 0, totalFGrades = 0, counter=0,maximum = 0, minimum = 9999, num, total = 0,smallest = 0,largest = 0;

       Scanner in = new Scanner(System.in);

       System.out.println("Enter exam percentage: ");

       System.out.println("Enter a negative examScore: ");

       int examScore = in.nextInt();

       while(examScore > 0)

       {

         counter++;

         if(examScore < 0){          

             break;}  

         else if(examScore > maximum){      

              maximum = examScore;}

         else if(examScore < minimum)   {  

              minimum = examScore;}

         

          total = total + examScore;  

     

          if(examScore <= 50 && examScore>0)

              smallest = examScore;

              if(examScore > 90 && examScore <=100)

              largest = examScore;

         

      if(examScore>=90 && examScore<=100)

          totalAGrades++;

      else if(examScore>=80 && examScore<=89)

          totalBGrades++;

      else if(examScore>=70 && examScore<=79)

          totalCGrades++;

      else if(examScore>=60 && examScore<=69)

          totalDGrades++;

      else if(examScore>=0 && examScore<=59)

          totalFGrades++;

      examScore = in.nextInt();

     

   }

      System.out.println("Total number of scores is = " + counter );

      System.out.println("Total Number of each Letter grade : " + counter);

      System.out.println("Percentage of total for each letter grade : ");

          System.out.println("Total number of A grades = "+ totalAGrades);

          System.out.println("Total number of B grades = "+ totalBGrades);

          System.out.println("Total number of C grades = "+ totalCGrades);

          System.out.println("Total number of D grades = "+ totalDGrades);

          System.out.println("Total number of F grades = "+ totalFGrades);

     

      System.out.println("Lowest exam Score is :"+smallest);

      System.out.println("Highest exam Score is :"+largest);

      System.out.println("Average exam Score = "+ (total / counter));

  }

}  

Explanation:

  • Get the exam information from user as input and run a while loop until examScore is greater than zero.
  • Use conditional statement to check the scores of students and increment the relevant grade accordingly.
  • Finally display all the information including grades and scores.
You might be interested in
Please help it would mean to world to me❤️ (WORD)
Leno4ka [110]
Its Option A - Bullets
Thank you!
6 0
3 years ago
Before renting or buying a multifamily dwelling you should know the __ of the building
mel-nik [20]
You should know the units :))))))))))))
8 0
3 years ago
Read 2 more answers
Need some help with Discrete Mathmatics please help urgent?
bearhunter [10]

Answer: 2, 4, 1, 5, 3

<u>Explanation:</u>

P: Arguments are not arranged in regular order like the one I am used to

Q: I cannot understand         ~Q: I can understand

R: I grumble                            ~R: I do not grumble

S: Get a headache

T: Examples are not easy

Here is the logic order of the given sentences:

2)   P

4)   P →  Q

1) ~Q → ~R

5) ~R →  S

3)   S →  T

∴)   T

5 0
3 years ago
place the steps in order for placing a section break Click the Layout tab Change the formatting style Choose a break option Posi
Valentin [98]

Answer:

Click the Layout tab

Choose a break option

Position the cursor Select Breaks

Change the formatting style

Explanation:

6 0
3 years ago
Read 2 more answers
Melba and her husband, Pablo, are getting divorced. Both of them retain considerable personal and financial information on their
hammer [34]

Answer/Explanation:

The attourney would most likely recommend that Melba should take steps to protect her computer from spyware and know that it is a privacy violation and potentially a criminal offense to install spyware on her husband's personal computer.

Cheers

8 0
3 years ago
Other questions:
  • Group technology identifies components by a coding scheme that specifies the
    13·1 answer
  • Which remote assistance option requires peer name resolution protocol (pnr) and ipv6?
    5·1 answer
  • Which data type requires the greatest number of bytes in computer memory? A. character B. integer C. single-precision number D.
    14·1 answer
  • Describe the GRANT statement and explain how it relates to security. What types of privileges may be granted? How are they revok
    15·1 answer
  • An author is preparing to send their book to a publisher as an email attachment. The file on their computer is 1000 bytes. When
    7·1 answer
  • Pls help me pass my finals!!​
    11·1 answer
  • I’ll give brainliest if answers are correct
    11·1 answer
  • Consider legal issues and intellectual property concerns when creating computer programs?
    11·1 answer
  • A combined counting and logical looping statement may be needed in the following situations: (a). The values stored in a linked
    7·1 answer
  • recursive function that accepts a stack of integers as a parameter and replaces every even value in the stack with two occurrenc
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!