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
Darya [45]
3 years ago
9

Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the a

verage test score. Write the following functions as part of the program:
calc_average: This function should accept five test scores as arguments and return the average of the scores.

determine_grade: This function should accept a test score as an argument and return a letter grade for the score based on the following grading scale.

Score Letter grade
90-100 A
80-89 B
70-79 C
60-69 D
Below 60 F
Computers and Technology
1 answer:
viva [34]3 years ago
5 0

Answer:

def calc_average(s1, s2, s3, s4, s5):

   return (s1 + s2 + s3 + s4 + s5) / 5

def determine_grade(s):

   if 90 <= s <= 100:

       return "A"

   elif 80 <= s <= 89:

       return "B"

   elif 70 <= s <= 79:

       return "C"

   elif 60 <= s <= 69:

       return "D"

   else:

       return "F"

scores = []

for i in range(5):

   scores.append(int(input("Enter a test score: ")))

   print(determine_grade(scores[i]))

print(str(calc_average(scores[0], scores[1], scores[2], scores[3], scores[4])))

Explanation:

Create a function called calc_average that takes 4 test scores, calculates their average, and returns the average

Create a function called determine_grade that takes a test score, returns the grade depending on the grading scale

Create an empty lists that will hold the test scores

Create a for loop to get test scores from the user. After getting a score, call the determine_grade function to determine the grade of the score

When the loop is done, call the calc_average function to calculate the average of the given test scores

You might be interested in
Please fill these out. I really need this done.
tatyana61 [14]

Answer:

i can't see this

Explanation:

5 0
3 years ago
Find the volume of the rectangular prism.<br>1<br>6 cm<br>32<br>cm​
Assoli18 [71]

Answer:

192 centimeters.

Explanation:

V= length x width x height

6 0
3 years ago
What are TWO examples of soft skills?
Elanso [62]
Computer programming and throubleshooting
3 0
3 years ago
3. Radheshree has to complete her assignment and submit it on the next day. While typing
Dafna1 [17]

Answer:

she can use the onscreen keyboard

this application is present in accessories file in the windows

5 0
2 years ago
Your computer has two basic types of software: system software and ________ software.
Elan Coil [88]
Hi!

Our computers will have system software and application software. Application software would be something like a game or just any general purpose app you've downloaded.

Hopefully, this helps! =)
5 0
3 years ago
Other questions:
  • ____ is high-quality encryption software that has become quite popular for creating secure e-mail messages and encrypting other
    9·1 answer
  • As part of his proofreading process, and to catch any spelling or grammar mistakes, John uses this feature in Word Online to hav
    7·1 answer
  • Write another function to convert a value to its word equivalent leveraging the following tuple - o Number = (‘One’, ‘Two’, … ‘N
    10·1 answer
  • What is the difference between a design pattern and a DLL?
    12·1 answer
  • In terms of object-oriented programming, after a class is defined,
    11·1 answer
  • In 2d design, form makes what possible?
    15·1 answer
  • Can someone please give me timetable managment system with data structures in java?
    11·2 answers
  • How to make a website
    15·2 answers
  • The Internet is based on a U.S. government project called ________. Today, the Internet is a collection of networks, tied togeth
    5·1 answer
  • Function of pons for class 7​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!