answer.
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]
2 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]2 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
Can someone please help me with this
inessss [21]

the first question answer is true

the second question answer is true

please brainliest me i just took the test so i know those 2 answers are correct!

3 0
2 years ago
What does the binary odometer show about representing large numbers​
Gelneren [198K]

Answer and Explanation:

The binary odometer represents the large number to judge that what happened when there is a large number that gets too large

Here we visit the level 2 of the binary odometer widget in the chapter of Code studio

This represents a widget that reproduced an odometer of a car in which the tracking of a device could be known that how much far the car is driven with respect to the miles or kilometers

7 0
2 years ago
Thelma is a web developer for a bowling league. She wants visitors to the website to be able to print web pages, such as league
prohojiy [21]

Answer:

"@page" is the correct answer for the above question.

Explanation:

  • "@page" is a syntax of CSS which will affect that page which is converted from the hard copy from the soft copy. It means it affects the page which will render the output.
  • So If the Thelma wants to set the margins on the output page then he can do this by the help of the "@page" tag which is defined in the CSS, and then the margin is set to this tag by the help of margin statement.
8 0
2 years ago
Exponentiation Is a/an operater?​
garik1379 [7]

Answer:

Yes it is

Hope this helps

5 0
1 year ago
Write a program that replaces words in a sentence. The input begins with word replacement pairs (original and replacement). The
marin [14]

Answer:

Following are the program in the Python Programming Language

#set variable to input sentence to replace words

sen = input()

#split that sentence

sen = sen.split()

#set variable to input whole sentence

get = input()

#set the for loop to replace words

for i in range(0, len(sen), 2):

 #check condition when words of sen is in get

 if sen[i] in get:

   #then, replace words

   get = get.replace(sen[i], sen[i+1])

#print the whole string after replacing

print('\n',get)

Explanation:

<u>Following are the description of the program</u>.

  • Set a variable 'sen' that get a sentence for replacing the word.
  • Split that sentence by split() method and again store that sentence in the following variable.
  • Set a variable 'get' that gets the whole sentence from the user.
  • Set the for loop for replacing words then, set the if conditional statement that checks the condition that the variable 'sen' in the variable 'get' then replace the words.
  • Finally, print the whole sentence after the replacement.
4 0
2 years ago
Other questions:
  • Which of these is an advantage of using the Clipboard task pane? A. You are able to apply OLE easily. B. There are more paste op
    15·2 answers
  • Marissa works at a company that makes perfume. She noticed many samples of the perfume were not passing inspection. She conducte
    6·2 answers
  • Which of the given information should you keep confidential and why? a. You see a memo with the name of your coworker, who will
    13·2 answers
  • What two methods can be used to access and modify an existing program that is running on an iot device in cisco packet tracer? (
    6·1 answer
  • Seneca has just applied conditional formatting and realizes that she has made a mistake. Which action should she take to fix the
    12·1 answer
  • The main problem with radio transmission is which of the following? Select one: a. Radio waves cannot travel through walls. b. W
    9·2 answers
  • Assume the existence of a Window class with a function getWidth that returns the width of the window. Define a derived class Win
    15·1 answer
  • For his class project, Matt has to create an image in a color scheme that has shade or tint variations of the same hue. Which co
    7·1 answer
  • A customer opened a file attachment, and now her PC is infected with ransomware. She's unable to open any of her files. Which ac
    11·2 answers
  • Write a program that uses the Purchase class in 5.13. Set the prices to the following: Oranges: 10 for $2.99 Eggs: 12 for $1.69
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!