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]
3 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]3 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
Matts has finished running some security automation scripts on three newly deployed Linux servers. After applying intrusion dete
gizmo_the_mogwai [7]

Answer: CPU

Explanation:

The management dashboard refers to the tool that's used in the presentation of the vital k management KPIs in a single place, which is efficiently managed in order to make faster and better decisions.

Based on the information given, after the application of intrusion detection, virus, and malware protection on the Linux images, he will notices an increase in CPU on his server management dashboard.

Therefore, the correct option is C.

5 0
2 years ago
Ipv6 includes a native information security framework (ipsec) that provides both data and control packets. true false
Galina-37 [17]
<span>The statement that IPv6 includes a native information security framework (IPsec) that provides both data and control packets is false.
</span>IPSec is a mandatory component for IPv6, and is used to natively protect IPv6 data <span>as it is sent over the network,. and not control packets.
</span>The IPv6 IPSec is a set of Internet standards that uses cryptographic security services to provide confidentiality ,data origin authentication and data integrity<span>
</span>

5 0
3 years ago
Many works by Mark Twain were published before 1923. In addition, there are other works that were discovered after his death and
Sauron [17]
I think is the last one
4 0
3 years ago
Orphan record example?
Goryan [66]

Answer:

If we delete record number 15 in a primary table, but there's still a related table with the value of 15, we end up with an orphaned record. Here, the related table contains a foreign key value that doesn't exist in the primary key field of the primary table. This has resulted in an “orphaned record”.

4 0
2 years ago
Which is true regarding pseudocode?
drek231 [11]

Answer:

It uses simple words and symbols to communicate the design of a program.

Explanation:

4 0
2 years ago
Read 2 more answers
Other questions:
  • what properties are associated with all Microsoft Office files and include author, title, and subject
    5·1 answer
  • Liza works as a receptionist. Around the lunch hour, she has a difficult time hearing the callers due to employees talking near
    12·1 answer
  • _______ are unprocessed facts that a computer feeds on.
    5·1 answer
  • A ____ is text and graphics that print at the bottom of every page.
    12·1 answer
  • By placing the chorale melody in the highest voice and using a simple harmonization, bach made it easier for congregation member
    5·1 answer
  • Hello, please help write code in C++. Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go nort
    12·1 answer
  • What does your digital footprint say about you? Does your digital footprint
    15·1 answer
  • Write an algorithm to sum to values
    11·1 answer
  • How do we explain the difference between fake news and facts​
    8·1 answer
  • A good algorithm should have which three components?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!