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
I have a bag of trail mix.half of the bag contains peanuts.1/4of the bag is chocolates candies, and 1/4of the bag is dried fruit
nika2105 [10]
A.) 1/2 Half the bags are peanuts so you have 1/2 a chance of selecting s peanut.
6 0
2 years ago
Read 2 more answers
(BRAINLIEST QUESTION!!!)
docker41 [41]

Answer:

Possible if hackers are not so intelligent.

Explanation:

Actually, hackers are intelligent

where they will change location code in different places every second. So end-user who is trying to trace it he or she has to use their intelligence to find the exact location of hackers.

Normally hackers will generate different location places and by using decipher it is possible to find the location codes.

Since hackers used encrypted message we need to decrypts the message and find it out and understand the decrypt and encrypt technology used by hackers.

It is possible to by using decipher to get uncovered locations

4 0
3 years ago
Kevin would like to ensure that his software runs on a platform that is able to expand and contract as needs change. Which one o
Reil [10]

A terminology which best describe Kevin's goal in terms of expansion and contraction as needs change is: A. Scalability.

<h3>What is scalability?</h3>

Scalability can be defined as a measure of the ability of a system to change (expansion or contraction) in performance and cost as a result of changes in demands of application and system processing, especially in a network architecture.

In this context, we can logically deduce that a terminology which best describe Kevin's goal in terms of expansion and contraction as needs change is scalability.

Read more on scalability here: brainly.com/question/14301721

#SPJ1

Complete Question:

Kevin would like to ensure that his software runs on a platform that is able to expand and contract as needs change.  Which one of the following terms best describes his goal? A. Scalability B. Elasticity C. Cost effectiveness D. Agility

8 0
1 year ago
Given the string variable address, write an expression that returns the position of the first occurrence of the string avenue in
Delicious77 [7]
It depends on a language you code. I think this could be either C++ or Java. I know answer for both of them.
For C++:  <span>address.find("Avenue")
For Java: </span><span>address.indexOf("Avenue")</span>
4 0
3 years ago
Consider an online shopping portal that allows a customer to browse and purchase different products. The products are arranged u
o-na [289]
Way too much to read bye
7 0
2 years ago
Read 2 more answers
Other questions:
  • The variable grade can have any real number value from 0 to 100. Ask the user to enter a grade in numerical form. Write an if-el
    9·1 answer
  • Changing the configuration of a database falls under which category of databaseâ administration?
    15·1 answer
  • Put the steps of the decision-making process in the correct order.
    12·1 answer
  • How many hosts are in each subnet?
    15·1 answer
  • Witch of the following is a valid why a scientist might a scientific theory
    13·1 answer
  • What is project scope? a. Quantifiable criteria that must be met for the project to be considered a success b. Products, service
    5·1 answer
  • Write an algorithm that accepts two numbers,
    7·1 answer
  • Which of these is a negative effect of computer technology's role in creating
    9·1 answer
  • B) The company's chief financial officer recognizes the need for an upgrade to the smart watches, but does not understand why th
    8·1 answer
  • Which generation of computer is most popular and why?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!