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]
4 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]4 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
What is a trojan horse in computer science?
Firdavs [7]

Answer:

type of malware that is often disguised as legitimate software. Trojans can be employed by cyber-thieves and hackers trying to gain access to users' systems. Users are typically tricked by some form of social engineering into loading and executing Trojans on their systems.

Explanation its malware

4 0
3 years ago
What is the purpose of requirements gathering
inn [45]

Answer:

to determine customer needs for a software

application

to reduce over scheduling of project

resources

Explanation:

Requirement gathering and analysis involves a business analyst and the client. And this is done in various phases with the first phase involving the business analyst and the client. And the second phase of software requirement is also being covered, and that is done by a team of System analysts, business analyst, and technical writers are part of both the team. However, both the phases have nothing to do with the bugs, and hence the first and the third part is not the correct part. However, customer needs are noted down, and in the second phase when resource requirement other than technical requirement is studied, partly it is ensured that there is no over the scheduling of the project resources during the project. And hence the second and the fourth options are the correct options.

3 0
3 years ago
Read 2 more answers
Write in general about ergonomic injuries and also mention the symptoms that computer users exhibit when they experience these s
Tema [17]

Ergonomic injuries are caused by ergonomic risk factors like awkward or sustained postures, strain, contact pressure, exposure to vibration and exposure to heat or cold. Over time, a combination of these factors may lead to injury, pain, and disability. Ergonomic injuries which can directly or indirectly be related to work environment can affect the nerves, tissues, muscles, tendons, and joints. For instance, on average, an employee may spend about 6-8 hours on the computer.

<span>The symptoms that computer users may exhibit when they experience these musculoskeletal disorders include pain in the shoulders, upper or lower back and the neck. Others include discomfort when making certain movements, loss of coordination, general feeling of cramping, weakness of muscle function, and a sharp burning stabbing  pain in the wrists.</span>
3 0
3 years ago
Read 2 more answers
• In your response, please include some examples of the three different types of storage.
babunello [35]
Hard Disk Drive
Solid State Drive
And Random Access Memory (RAM)
6 0
4 years ago
Read 2 more answers
WILL GIVE MEDAL NEED HELP ASAP
love history [14]

Answer:

English consonants (P, Q, R, etc.).

5 0
3 years ago
Other questions:
  • The outstanding disk requests are for tracks 6,10,4,20,36,8, and 40 in that order. Assume that the seek time speed is 5 msec/tra
    14·1 answer
  • Xavier loves to sing and hum, and he always has music softly playing while he studies. The learning style that best fits Xavier
    6·2 answers
  • Which phase takes all the detailed design documents from the design phase and transforms them into the actual system? Testing ph
    7·1 answer
  • Write a main method that prompts the user for an integer between 1 &amp; 20 (inclusive). If the user enters an invalid number, p
    8·1 answer
  • The main benefit of shielded twisted pair cabling over unshielded twisted pair is that STP is much more durable.
    13·1 answer
  • Write a program to enter a number and test if it is greater than 45.6.if the number entered is greater than 45.6 the program nee
    13·1 answer
  • Software people commonly use in the workplace to make their life easier is called?
    11·2 answers
  • Anyone use zoom<br><br>code:- 2574030731<br>pass:- HELLO<br>Z●●M ​
    14·2 answers
  • When a value of one data type is automatically changed to another data type, a(n) ____________________ type coercion is said to
    7·1 answer
  • Weak passwords are a(n) ___________ threat
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!