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
4. When inserting clip art into a page of text, which of the following is true? (1 point)
ella [17]
I would vote for D since you can adjust picture positioning and wrapping. A is BS, B and C are not true.
8 0
2 years ago
Read 2 more answers
What is the decimal value for the jump control?
Allushta [10]

Answer:

24

Explanation:

11000 is equivalent to 24 because if you look at a flippy do, the base is 2. so going from right-left, 2^0 is 1 for the first 0. second zero would be 2^1 which is 2. then the third zero is 4 (2^2). since they are zero’s, they are turned off, but the 1’s indicate that those bases are turned on. the first one going from right to left would then be 8 (2^3) and the last 1 going from right-left is 16 (2^4). so 16+8=24!

edit: didn’t mean to rate myself 1 star lol

4 0
2 years ago
In Microsoft Access, what happens when you save a query once and run it but then add more to the query? What will happen? a)erro
Usimov [2.4K]
D)When the query is run again, the data that meets the new criteria will be retrieved.
5 0
3 years ago
What is a conditional statement? What is another name for conditional statement? Give 2 examples of conditional statements?
vlada-n [284]

Answer:

A conditional statement instructs a system to do action based on whether a condition is true or false. This is frequently expressed as an if-then or if-then-else expression. A conditional statement is applied to predicate choices on circumstances. When there is no condition around the instructions, they run sequentially. If you add a condition to a block of statements, the execution flow may alter depend on the outcome of the condition. It is also known as a one-way selection statement because we utilize the if condition, provide the argument, and if the argument is passed, the relevant function is performed; else, nothing happens. 

Examples of conditional statements:

1)<em> int time = 20;</em>

<em>if (time < 16) {</em>

<em>  System.out.println("Have a good day.");</em>

<em>} else {</em>

<em>  System.out.println(" Enjoy your evening.");</em>

<em>}</em>

<em />

2) <em>using namespace Conditional;</em>

<em>static void Main(string[] args) </em>

<em>{</em>

<em>  // This method determines what a user should do for the day based on the weather condition </em>

<em />

<em>  public void Weather(string myWeather)</em>

<em>  {</em>

<em>    // 1st condition</em>

<em>    if (myWeather == "Sun")</em>

<em>    {</em>

<em>      // Decision</em>

<em>      Console.WriteLine("Go to the beach");</em>

<em>    }</em>

<em>    // 2nd condition</em>

<em>    else if (myWeather == "Rain")</em>

<em>    {</em>

<em>      Console.WriteLine("Go to the library")</em>

<em>    }</em>

<em>    // 3rd condition</em>

<em>    else if (myWeather == "Cloudy")</em>

<em>    {</em>

<em>      Console.WriteLine("Go to the park")</em>

<em>    }</em>

<em>    else</em>

<em>    {</em>

<em>      //otherwise</em>

<em>      Console.WriteLine("Rest at home")</em>

<em>    }</em>

<em>  }</em>

<em>}</em>

8 0
1 year ago
Complete the paragraph below.
tiny-mole [99]

Answer:

inject, update

Explanation:

Dependency injection is a concept in object-oriented programming that links or transfers the functionality of an independent class to a dependent class.

Assuming two classes, Vehicle and Bus are created, the Bus class inherits from the Vehicle. The Bus class is dependent on the Vehicle class and its instances create instances of the Vehicle object.

It is easier and faster to update the Bus class and other classes that inherit from the Vehicle class by updating only the Vehicle class.

3 0
3 years ago
Other questions:
  • Write an example method that overrides the operator to create a new book whose title is a concatenation of the titles of two boo
    15·1 answer
  • Lance has three tables in his database he wants to generate a report to show the data from the three table so he decides to link
    6·2 answers
  • Why are using some special characters (@, #, !, etc.) not a good idea?
    13·2 answers
  • How does the mantle interact with the tectonic plates at a convergent boundary?
    14·2 answers
  • (20 POINTS AND BAINLIEST)
    9·1 answer
  • When you write Click a picture in a word processing program which actions can you choose to perform on the image
    6·1 answer
  • Provide a few examples of how cryptography actually secures data.
    8·1 answer
  • Send link for a qc or paddle
    11·1 answer
  • Write a question that the database will understand. Which records do not contain "sold"?
    14·1 answer
  • A 4"x6" photo is digitized using 10,000 pixels. An 11"x7" photo is digitized using 30,000 pixels. Which image will have the bett
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!