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
5.William travels a lot on business purpose. He needs to regularly communicate with his business partner. He also needs to send
FromTheMoon [43]

Microsoft Online is free to use. It includes Microsoft Excel, Word, One - Note and PowerPoint.  Microsoft Outlook (email app) is free as well, although it is a seperate download.

Another way to go is via Google docs, The Google drive is rather large and safe to store reports, docs, images, etc.

Both Microsoft online and Google Docs are accessible to use on virtually any device as in: PCs, Laptops, Tablets, Androids and Iphones.


4 0
3 years ago
Hardware failure, power outages, and DOS attacks will affect:
const2013 [10]

Answer:

The answer should be data availability

6 0
3 years ago
. Here is a sequence of addresses during execution of some program: 4, 16, 0, 20, 52, 68, 172, 64 Assuming a fully associative c
k0ka [10]

Answer:

See explaination for the illustrations on the question.

Explanation:

A program cache miss usually occurs at the instance of an instruction fetch failing to read an instruction from the program cache and the processor is required to access the instruction from the next level of memory. A request to L2 or external memory has a much higher latency than an access from the first level instruction cache.

A cache on its own can be defined as is a hardware cache used by the central processing unit (CPU) of a computer to reduce the average cost (time or energy) to access data from the main memory.

Please kindly check attachment for the step by step diagramming illustrations of the questions.

6 0
4 years ago
Please help me with this!
Aleksandr [31]

def zipZapZop():

   number = int(input("Enter the number: "))

   dictionary = {3: "zip", 5: "zap", 7: "zop"}

   amount = 0<em> #amount of non-divisible numbers by 3, 5 and 7</em>

<em>    for key, value in dictionary.items():</em>

       if(number%key == 0): <em>#key is the number</em>

           print(value) <em>#value can be or zip, or zap, or zop</em>

       else: amount += 1 #the number of "amount" increases every time, when the number is not divisible by 3, or 5, or 7

   if(amount == 3): print(number)    <em>#if the number is not by any of them, then we should print the number</em>

zipZapZop()

4 0
3 years ago
Hi guys help me plz . How to get ios 10 zip file for android devices ? or how to port ios 10 or higher for htc one me ?
Vladimir79 [104]
While you set up your new iOS device, look for the Apps & Data screen. Then tap Move Data from Android. (If you already finished setup, you need to  erase your iOS device and start over. If you don't want to erase, just transfer your content manually<span>.)</span>
4 0
3 years ago
Other questions:
  • Int, char, bool, and double are all valid data types in c , true or false
    15·1 answer
  • Which statement relating to a Works Cited page is NOT True?
    11·2 answers
  • After reviewing the various types of network connections available, a client chooses a network connection that is considered to
    13·1 answer
  • Andy is trying to put together a holiday gift knapsack (with W=8) for Sarah. He has n items to choose from, each with infinitely
    15·1 answer
  • What kind of music is liked the most by people
    5·2 answers
  • Can someone help me with these questions it's for drivers ed
    10·1 answer
  • Three Cat 5e cables were run from an office area to three computers in a machine shop. Work took place on the weekend when the m
    14·1 answer
  • 9. If you want to change the Header text of any Form then which property will you use
    10·1 answer
  • Help a brotha out..................
    10·1 answer
  • Draw a flowchart diagram for a program that displays numbers 1 to 20
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!