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
postnew [5]
4 years ago
14

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 gr

ades 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

Computers and Technology
2 answers:
d1i1m1o1n [39]4 years ago
6 0

Answer:

# user is prompt to enter a grade

grade = int(input("Enter your grade: "))

# empty list to hold user grades is declared

grade_list = []

# counter for A grade is initialised to 0

numberOfA = 0

# counter for B grade is initialised to 0

numberOfB = 0

# counter for C grade is initialised to 0

numberOfC = 0

# counter for D grade is initialised to 0

numberOfD = 0

# counter for F grade is initialised to 0

numberOfF = 0

# while loop that continue to receive

# user input as long as it is not -1

# it append each grade into the grade list

while (grade != -1):

grade_list.append(grade)

grade = int(input("Enter your grade: "))

# for loop that goes through

# the grade list and increment

# the respective grade based on

# the interval it fall

for each_grade in grade_list:

if(each_grade >= 90 and each_grade <= 100):

numberOfA += 1

elif(each_grade >= 80 and each_grade < 90):

numberOfB += 1

elif(each_grade >= 70 and each_grade < 80):

numberOfC += 1

elif(each_grade >= 60 and each_grade < 70):

numberOfD += 1

elif(each_grade >= 0 and each_grade < 60):

numberOfF += 1

# total grade is displayed to the user

print("Total number of grades = ", len(grade_list))

# number of A's is displayed to user

print("Number of A's = ", numberOfA)

# number of B's is displayed to user

print("Number of B's = ", numberOfB)

# number of C's is displayed to user

print("Number of C's = ", numberOfC)

# number of D's is displayed to user

print("Number of D's = ", numberOfD)

# number of F's is displayed to user

print("Number of F's = ", numberOfF)

Explanation:

The program is written in Python and is commented.

It asked for user input. Then it continues to receive input as long as it is not -1. It append each input to a list.

It then loop through the list and increment the correct counter for each grade.

It then display the total number of grade inputted and the number of various grade.

Maslowich4 years ago
5 0

Answer:

I am writing a C++ program.

#include <iostream> //to use input output functions

using namespace std; //to identify objects such as cout, cin

int main(){//start of main() function body

/*integer type variables A B C D and F are used to store the number of grades in each category example 90 to 100 is a A so its stored in A variable*/

               int A = 0;

 int B = 0;

 int C = 0;

 int D = 0;

 int F = 0;

 int total_grades=0; //counts and stores the total number of grades

//prompts user to enter exam scores

cout<<"Enter exam scores as integer percentages from 0 to 100:\n";

  int exam_score; // stores exam scores entered by user

  cin>>exam_score; // reads exam scores input by user

/* while loop continues to count the total number of grades and grades in each letter grade category until the user enters a negative value to end loop */

 while(exam_score>0){ //iterates till value of score is greater than 0

//increments the value of total_grades by 1 every time user enters the grade

                              total_grades++;

/*if condition checks if the value of exam_score is in the specified range of each grade category and increments that grade variable accordingly*/

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

    A++;

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

    B++;

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

    C++;

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

    D++;

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

    F++;

   cin>>exam_score;   }

/*when the loop ends the total number of grades and number of grades in each letter grade category is displayed*/

 cout<<"Total number of grades :"<<total_grades<<endl;

 cout<<"Number of A's: "<<A<<endl;

 cout<<"Number of B's: "<<B<<endl;

 cout<<"Number of C's: "<<C<<endl;

 cout<<"Number of D's: "<<D<<endl;

 cout<<"Number of F's: "<<F<<endl;

}

Explanation:

The program first prompts the user to enter the exam scores. The while loop begins which keeps counting the number of grades and stores it in total_grades variable. Then the if condition checks for each letter grade category and counts the grades in each letter grade accordingly. For example if the exam score entered by user is between 90 to 100 then this means that the letter grade category is A , so the value of A is incremented by 1. The loop continues to execute until the user enters a negative value. For example if the user enters -1, then the loop breaks. At the end the total number of grades and the number of grades in each letter grade category which are computed in the while loop are displayed as output.

You might be interested in
. the fact that a web app is written to be run within any of the standard
Evgen [1.6K]

The correct answer is C) ease of use.

The fact that a web app is written to be run within any of the standard browser and on any platform on which that browser operates is called "ease of use."

The ease of use concept indicates that the product is "amicable" or "friendly" to use by most people because it is not required andy technical knowledge to operate the product. In this case,  the app is written to be run within any of the standard browser and on any platform on which that browser operates, so it is "friendly" to operate bu most systems. App's companies and software companies created this "ease of use" concept for many of their products so they can sell most of them because people know they are easy to use and functional.

7 0
4 years ago
A ______ oversees the planning and implementation of sophisticated security measures to block unauthorized access but at the sam
meriva
A-database administrator
8 0
3 years ago
Which of the following is an example of intellectual property?
Gnesinka [82]

Answer:

B. Programming code for a video game

Explanation:

An item is considered an intellectual property if it is intangible in the sense that the actual property cannot be touched and it does not have a physical presence.

Options A, C and D do not fall in this category because they are tangible and they have physical presence.

Only option A, programming source code does not fall into this category.

Hence, <em>B. Programming code for a video game </em> answers the question

8 0
3 years ago
FIGURE A-2—Use the information in this chart to answer Question 2.
Alex777 [14]
The answer is a because that is what is supported
3 0
3 years ago
Write a Java program that prompts the user to enter integer values for the sides of a triangle and then displays the values and
satela [25.4K]

Answer:

import java.util.Scanner;

public class triangle {

       public static void main (String [] args) {

           int sideOne, sideTwo, sideThree;

           Scanner in = new Scanner (System.in);

           System.out.println("Enter the first side of the triangle");

           sideOne = in.nextInt();

           System.out.println("Enter the secon side of the triangle");

           sideTwo = in.nextInt();

           System.out.println("Enter the third side of the triangle");

           sideThree = in.nextInt();

           if ( sideOne<=0||sideTwo<=0|| sideThree<=0){

               System.out.println(" The Values enter are "+sideOne+ "," +sideThree+ ","+sideThree+ " These values don't make a valid triangle");

           }

           else if ((sideOne + sideTwo> sideThree) || (sideOne+sideThree > sideTwo) || (sideThree+sideTwo > sideOne))

           {

               System.out.println ("The triangle is Valid");

           }

           else {

               System.out.println(" The Values enter are "+sideOne+ "," +sideTwo+ ","+sideThree+ " These values don't make a valid triangle");

           }

       }

Explanation:

for a Triangle to be Valid one of the three sides of the triangle must greater than the other two sides.  The code above enforces this condition using an if statement in combination with the Or Operator

The following conditions where enforced

side one, side two and side three != 0

Side One + Side Three > Side Two

Side Three + Side Two> Side One

Side Two + Side One > Side Three

7 0
3 years ago
Other questions:
  • *****NEED HELP ASAP!!!! COMPUTER HELP!!!! PLEASE!**
    13·1 answer
  • A(n) ____ database is an application appropriate for an object-oriented database that contains text links to other types of docu
    7·1 answer
  • Why should you not perform any personal grooming task while driving?
    5·2 answers
  • It is advised to always have discretion with leaders. Explain in general terms what information security policies can and cannot
    12·1 answer
  • What is not true about field properties in Access?
    13·1 answer
  • What software could i use to create music like Aphex Twin?
    6·1 answer
  • Define application software​
    12·1 answer
  • I need them on this question
    5·1 answer
  • What would a system unit that is integrated with the display and keyboard would be considered?
    6·1 answer
  • Computer science is a blank process
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!