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
liraira [26]
3 years ago
5

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

of grades and the number of grades in each letter-grade category as follows: 90 to 100 is a A, 80 to 89 is a B, 70 to 79 is a C, 60 to 69 is a D, and 0 to 59 is an F. Use a negative score as a sentinel value to indicate the end of the input. (The negative value is used only to end the loop, so do not use it in the calculations.) For example, if the input is 98 87 86 85 85 78 73 72 72 72 70 66 63 50 -1 the output would be Total number of grades = 14 Number of A's = 1 Number of B's = 4 Number of C's = 6 Number of D's = 2 Number of F's = 1 loop

Computers and Technology
1 answer:
Licemer1 [7]3 years ago
8 0

Answer:

import java.util.Scanner;

public class Program

{

public static void main(String [] Args)

{

int A_grades = 0;

int B_grades = 0;

int C_grades = 0;

int D_grades = 0;

int F_grades = 0;

int count=0;

int max = 0;

int min = 9999999;

int num;

int total = 0;

int smallest = 0;

int largest = 0;

Scanner in = new Scanner(System.in);

System.out.println("Enter exam score as integer percentage in range 0 to 100");

System.out.println("And enter a negative score at the end of the list :");

int score = in.nextInt();

while(score>0)

{

count++;

if(score < 0){ // negative number

break;} // exit the infine loop

else if(score > max){ // find bigger one

max = score;}

else if(score < min) { // find smallest one

min = score;}

total = total + score; // the total for average

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

smallest = score;

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

largest = score;

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

A_grades++;

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

B_grades++;

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

C_grades++;

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

D_grades++;

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

F_grades++;

score = in.nextInt();

} //end while

System.out.println("Total number of scores is : " + count );

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

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

System.out.println("Total number of A grades :"+ A_grades);

System.out.println("Total number of B grades :"+ B_grades);

System.out.println("Total number of C grades :"+ C_grades);

System.out.println("Total number of D grades :"+ D_grades);

System.out.println("Total number of F grades :"+ F_grades);

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

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

System.out.println("Average score : "+ (total / count));

}

}

Explanation:

The Java program is such that functions in this manner, It reads a list of exam scores given as integer percentages in the range 0 to 100. Displays the total number of grades and the number of grades in each letter-grade category as follows: 90 to 100 is a A, 80 to 89 is a B, 70 to 79 is a C, 60 to 69 is a D, and 0 to 59 is an F.

See attachment for program output.

You might be interested in
Your internet is out, and devices connected by WiFi and ethernet will not connect. You check several websites, and all your pack
tiny-mole [99]

Answer:

a) Open the DNS settings on your router and try using a different DNS.

Explanation:

The DNS or domain name service is a protocol that majorly assigns a URL string to an IP address. This is because the IP address as a number is easily forgotten.

In the question above, the operator could not access the websites with the URL name but can confirm connectivity to the site with its IP address. This means that the IP address can be used to access the websites directly, so, the DNS protocol is either not configured or is down.

6 0
2 years ago
Toshiba Corporation makes computer chips. Toshiba Corporation would be classified as a A. merchandising company. B. manufacturin
solmaris [256]

Answer: Option 'B'

Explanation: They will be referred to as a manufacturing company because of they make the necessary part themselves not buy it from somewhere else.

5 0
3 years ago
What does the following program do? student = 1 while student &lt;= 3: total = 0 for score in range (1,4): score = int(input("En
sukhopar [10]

Answer:

The code requests for the scores of three students for three courses offered by each student.

It calculates and print the average score for each student

Explanation:

The code written in Python programming language uses a while to get student 1-3 and a for loop to get scores for course 1-3

See attached code and output

6 0
3 years ago
What kind of music is liked the most by people
Varvara68 [4.7K]
A . Pop
D . K-popp I guess
6 0
3 years ago
Read 2 more answers
What is the use of jacquard loom
alexdok [17]
The loom was made in 1801 and was made with a series of punched cards. They weaves a pattern of threads. The invention came to be known as Jacquards loom. It is controlled by a a system of stiff punch cards and hooks. Each row of holes punches in the cards corresponds to one row of thread in the design.
7 0
3 years ago
Other questions:
  • What would be the desired output of a home security system?
    6·1 answer
  • Match the limits of the user with an appropriate design response. 1. severe arthritis, unable to type or use a mouse on a reliab
    11·1 answer
  • What is the effect of block size in cache design?
    12·1 answer
  • Potential Energy and Kinetic Energy both mean "energy in motion" True or False​
    8·2 answers
  • The Ntds. dit file is a database that stores Active Directory data, including information about user objects, groups, and group
    7·1 answer
  • Write the syntax of FOR......NEXT loop​
    13·1 answer
  • Edhesive 6.8 lesson practice answers
    10·1 answer
  • In this image, we are clicking a button on the Quick Access Toolbar. What will happen
    6·1 answer
  • In disc brakes, pads are forced against the of a brake disc​
    14·1 answer
  • Type the correct answer in the box. Spell all words correctly. Code in which server-side language can be embedded into an HTML d
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!