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
anzhelika [568]
3 years ago
9

Write a program to calculate student's average test scores and the grade. You may assume the following input data:

Computers and Technology
1 answer:
Brums [2.3K]3 years ago
7 0

Answer:

def gradeAverage():

   grades = []

   i = 0

   while i < 5:

       a = int(input('enter score ' + str(i + 1) + ': '))

       grades.append(a)

       i = i+1

   #print(grades)

   average = sum(grades)/len(grades)

   #print(average)

   return average

def lettergrade(a):

   letter = 'A'

   if a < 60:

       letter = 'F'

   elif 59 < a < 63:

       letter = 'D-'

   elif 62 < a < 67:

       letter = 'D'

   elif 66 < a < 70:

       letter = 'D+'

   elif 69 < a < 73:

       letter = 'C-'

   elif 72 < a < 77:

       letter = 'C'

   elif 76 < a < 80:

       letter = 'C+'

   elif 79 < a < 83:

       letter = 'B-'

   elif 82 < a < 87:

       letter = 'B'

   elif 86 < a < 90:

       letter = 'B+'

   elif 89 < a < 94:

       letter = 'A-'

   elif 93 < a < 101:

       letter = 'A'

   return letter

numOfStudents = int(input('How many students: '))

names = []

aver = []

grade =[]

while numOfStudents > 0:

   studentName = input('Enter students name: ')

   names.append(studentName)

   a = gradeAverage()

   aver.append(a)

   grade.append(lettergrade(a))

   numOfStudents = numOfStudents - 1

for name in names:

       for score in aver:

           for letter in grade:

               if names.index(name) == aver.index(score) == grade.index(letter):

                   print('%s : Average =  %d  Letter Grade:  %s \n' %(name, score, letter))

                   break

Explanation:

The programming language used is python.

Two functions were created, the first function gradeAverage() was used to calculate the average values of the scores.

The second function lettergrade(a) was used to get the letter grade i.e(A, A-, C, D, e.t.c.) and it takes its argument from the average.

The main block of code asks for how many students are there and prompts the user to input their names and scores for all the students.

It takes that data calculates the average and the letter grade and prints out the names of the students, their average and their letter grade.

You might be interested in
Describe data center technology and its relevance to modern-day cloud computing
Semmy [17]

Answer and Explanation:

Data center has developed over some stretch of time with new innovations and structures showing up in this industry.  

It incorporates everything to back and maintain a major business in the network.  

It sends all the framework for machines which incorporates support for applications and the machines' security.  

In modern day computing it assumes a significant role as it enables organizations to put everything remotely for the client.  

With this innovation client can run different commands and can tests programs for a considerable length of time or months, any time as client as a rule signs in a remote machine and works.

It likewise enables organizations as it to keep everything on the cloud and there are less odds of assaults as everything is brought together.

6 0
3 years ago
Name 3 supercomputers along with their cost, purpose and the country it is located.​
Alika [10]

Answer:

The three super computers are

a) Fujitsu Fugak

b) IBM Summit/IBM/Nvidia/Mellanox

c) Sunway TaihuLigh

Explanation:

Three super computers are as follows

a) Fujitsu Fugak - It is located in Kobe, Japan and its costs is ¥130 billion

b) IBM Summit/IBM/Nvidia/Mellanox - It is located in Oak Ridge, U.S. and it costs $325 million

c) Sunway TaihuLigh- It is located in Wuxi, China and it costs US$273 million

5 0
3 years ago
 In which part of a professional email should you try to be brief, but highly descriptive? 
quester [9]
The subject line should be a brief message explaining some of the contents of the email.
4 0
3 years ago
When an IPv6 device with no pre-configured IPv6 address powers up, it can calculate a global 128-bit IPv6 address for itself usi
RSB [31]

Answer:

True

Explanation:

IPv6 Is a later version of IP addresses, used to solve the problem of the limited number of IPv4 addresses in the network.

Just like IPv4, IPv6 can also is configured to a device statically and dynamically. Dynamic IPv6 configuration could be a stateless autoconfiguration SLAAC, a stateless DHCPV6 or a stateful DHCPV6.

The IPv6 address is configured with a prefix and a prefix length and a EUI generated 64 bit interface or a random interface id by the device.

8 0
4 years ago
What are the services offered by web-based email?​
slega [8]

Answer:

Web based email is a service that allows to access and use electronic mail via web browser.

It allows clients to login into the email software running on a web server to compose, send and receive, delete mails basically.

8 0
3 years ago
Other questions:
  • Write a Tip Calculator in code in VMware Fusion
    13·1 answer
  • Sleeping is an effect of _______ , but agitation may cause a person to wake up
    7·2 answers
  • What does NVRAM stand for
    8·2 answers
  • The figure below shows a black and white image with a resolution of 720×504. Identify how much memory (in bits) will be occupied
    15·1 answer
  • While waiting to be seated at a restaurant, Jason receives a customer loyalty coupon through an app on his mobile phone for half
    7·1 answer
  • A junior network administrator tells you that he can ping a DNS server successfully using its IP address, but he has not tested
    11·1 answer
  • Tips for Interactions with Personalized LinkedIn Outreach?
    5·1 answer
  • Sistema binario, realizar el pasaje de binario a decimal; 00110011 11101100 11100001 11001100 10010101 11001111 10000001 1000110
    14·1 answer
  • During the preventive maintenance phase of a project involving a hydraulic power system, an engineer must change a gasket on a p
    14·1 answer
  • 20 ponts!!!dorothy has made a website for her hair salon on a wysiwyg editor. she wants her website to appear on the first page
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!