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
padilas [110]
3 years ago
11

Write a program to read a list of exam scores given as integer percentages in the range O 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 an A , 80 to 89 is a B, 70 to 79 is a C, 60 to 69 is a D, and O 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 72 70 66 63 50 -1

The output would be
Total number of grades =14Number of A's =1»Number of B's= 4Number of C's= 6Number of D'S
2Number of F's =1
Computers and Technology
1 answer:
Hitman42 [59]3 years ago
7 0

Answer:

  1. def determineGrade(score):
  2.    if(score >= 90):
  3.        return "A"
  4.    elif(score>=80):
  5.        return "B"
  6.    elif(score>=70):
  7.        return "C"
  8.    elif(score>=60):
  9.        return "D"
  10.    else:
  11.        return "F"
  12. totalGrade = 0
  13. aCount = 0
  14. bCount = 0
  15. cCount = 0
  16. dCount = 0
  17. fCount = 0
  18. user_score = int(input("Enter your score: "))
  19. while(user_score > 0):
  20.    totalGrade += 1
  21.    grade = determineGrade(user_score)
  22.    if(grade == "A"):
  23.        aCount += 1
  24.    elif(grade == "B"):
  25.        bCount += 1
  26.    elif(grade == "C"):
  27.        cCount += 1
  28.    elif(grade == "D"):
  29.        dCount += 1
  30.    else:
  31.        fCount += 1
  32.    user_score = int(input("Enter your score: "))
  33. print("Total number of grades = " + str(totalGrade))
  34. print("Number of A's = " + str(aCount))
  35. print("Number of B's = " + str(bCount))
  36. print("Number of C's = " + str(cCount))
  37. print("Number of D's = " + str(dCount))
  38. print("Number of F's = " + str(fCount))

Explanation:

Firstly, we can define a function <em>determineGrade()</em> that takes one input values, score, and determine the grade based on the letter-grade category given in the question. (Line 1 - 11)

Next, we declare a list of necessary variables to hold the value of total number of grades, and total number of each grade (Line 13 -18). Let's initialize them to zero.

Next, we prompt for user input of the first score (Line 20).

To keep prompting input from user, we can create a while loop with condition if the current <em>user_input</em> is not negative, the Line 22 - Line 35 should keep running. Within the while loop, call the determineGrade() function by passing the current <em>user_input</em> as argument to obtain a grade and assign it to variable <em>grade</em>.  

We develop another if-else-if statements to track the number of occurrence for each grade (Line 26 - 35). Whenever a current <em>grade</em> meet one of the condition in if-else-if statements, one of the counter variables (aCount, bCount... ) will be incremented by one.

By the end of the while-loop, we prompt use for the next input of score.

At last, we display our output using <em>print()</em> function (Line 39 - 44).

You might be interested in
Two Technicians are discussing Tire Fitment information.
IRISSAK [1]

Only technician A is correct.

Technician A only

<u>Explanation:</u>

According to technician A, tire fitment information provides specific specs of the vehicle including the inflation pressure, OEM tire size, and lug nut tire sequences. The class of vehicles is divided into a category of vehicles and these categories are further specialized to form different models. Each model has its own specifications and their requirements differ from one another.

Hence the tire fitment of each vehicle should convey specific information about the model in concern. For instance, the optimum inflation pressure of a Royal En field will not be the same as that of Hero Splendour as both have a huge difference in their respective weight and size.

4 0
3 years ago
What method parses its string argument to determine whether the string can be converted to a number?
den301095 [7]
The correct answer is: Tryparse method
6 0
3 years ago
Contast between backups controlled within the SAN and backups controlled from the application server.
luda_lava [24]

Answer and Explanation:

Backup control within the SAN is one which confines the backup to the SAN and does not pass it via corporate network.

Backup traffic within the SAN are  easier to maintain and easily handled in contrast to the application server.

Backup in SAN is governed by  such applications and mechanism which allows the easy handling of the backup traffic which is not provided by the application servers.

In case of occurrence of any failure,  unlike application server, SAN provides smooth and fast migration

SAN holds data in cluster  by the use of backup techniques not used in application server.

6 0
3 years ago
In order to be compliant with the NIST publications, policies must include key security control requirements. One of these key r
rodikova [14]

Answer:

The answer is "Option A".

Explanation:

A comprehensive collection of principles, guidelines, proposals, and studies on information and information systems privacy and safety are produced and carried out in the NIST publications.

  • The FIPS management standards for federal information and security laws contain various technical reporting sequences.
  • This process takes place after a plan is identified, reviews are carried out and risk analysis is performed.
8 0
3 years ago
A broadcast network is one in which a transmission from any one attached station is received by all other attached stations over
love history [14]

Answer:

In a broadcast network such as radio network for example a walkie talkie, the broadcasted transmission is received equally by all receivers indiscriminately which may lead to dissemination of classified information to an unauthorized receiver, therefore, the network layer is required is needed to ensure proper routing of the information

Similarly, when the all the broadcasters in one location are each trying to send messages to different receivers at another given location, there would be potential for network congestion and it would be difficult to send information through the network

When there is need for priority service the presence of a network layer is needed in the network

However, when the above functions performed by the network layer is not required, then, the network layer can be excluded, such as the communication between layers 4 - 7 of the OSI model

Explanation:

8 0
3 years ago
Other questions:
  • A security policy is a
    11·1 answer
  • 2. What is the layout of the modern keyboard known as?
    13·1 answer
  • "What technology will examine the current state of a network device before allowing it can to connect to the network and force a
    13·1 answer
  • What is a ribbon in word
    15·2 answers
  • Now now now now mowewweedeeee
    13·1 answer
  • graphic designers can compress files in different formats . One of the formats ensures that the quality and details of the image
    7·1 answer
  • Daiki is creating a database for a paint store. Each color of paint would have its own record which will include the color name
    5·2 answers
  • Company-wide systems that connect one or more local area networks (LANs) or wide area networks (WANs) are called _____.
    6·1 answer
  • Two technicians are discussing Newton's first law of motion. Technician A says that a lightweight vehicle requires as
    8·1 answer
  • Computer professionals known as software engineers, or Blank______, use the software development life cycle to create software r
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!