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
Hey plz help me with this<br>What is malware short for?​
soldier1979 [14.2K]

Answer:

Malware is the collective name for a number of malicious software variants, including viruses, ransomware and spyware. Shorthand for malicious software, malware typically consists of code developed by cyberattackers.

Explanation:

4 0
2 years ago
Which header will be the largest?<br><br> Hello<br><br> Hello<br><br> Hello<br><br> Hello
geniusboy [140]

Answer:  

Bye

bye

bye

bye

Explanation:

4 0
3 years ago
Read 2 more answers
Lindsay owns a candy store that typically makes all of its sales to tourists visiting a nearby zoo. Why might she decide to set
umka2103 [35]
Social media is so powerful in this generation because it is able to reach many different corners of the world. It is not only used merely for communication but also sometimes or most of the times for business. For Lindsay, the use of social media will allow her to increase the size of the customer base. The answer is letter A. 
4 0
3 years ago
Read 2 more answers
Which is an example of a variable name written in camelcase?
NemiM [27]

Answer:

Option (a) myCar

Explanation:

Option (a) is Correct

If there are two or more words in variable we can use camel case to declare the variable. In camel case first character of first word is either a lowercase alphabet or underscore (_) and first character of second word is a uppercase alphabet. ex: empNum, myCar

So the Option (a) myCar is correct among the given options

Option (b) is incorrect

Since both the first letter of two words are in lower case which is not according to camel case rules

Option (c) is incorrect

The first letter of first word is in lower case first character of second word is a uppercase alphabet but there is a gap so it is not valid .

Option (d) is incorrect

The first word is in upper case and first character of second word is a uppercase alphabet it is not valid.

6 0
3 years ago
Read 2 more answers
List 2 end to end test commands. <br><br> Will mark Brainliest!!
Delvig [45]

Answer:

ibm pll

Explanation:

4 0
2 years ago
Other questions:
  • What is the purpose of the print area feature​
    11·1 answer
  • Why is it important to ensure that dns servers have been secured before implementing an e-mail system? awr138?
    10·1 answer
  • Which of the following is the correct code to link the text "Sunny Days" to the website www.sunnysunshine.com?
    15·1 answer
  • What type of network access control uses Active Directory to scan a device to verify that it is in compliance?
    11·1 answer
  • 1. What does MS-DOS use for input?
    5·1 answer
  • Which of the following access control techniques allows the user to feel empowered and able to change security attributes?
    5·1 answer
  • Match the characteristics to the mobile operating system that it describes.
    11·1 answer
  • Who's hype for Halo Infinite?
    11·2 answers
  • Which role will grant a delegate read-only access to a particular workspace within a user’s Outlook mailbox?
    15·2 answers
  • Identify five type of application software​
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!