Ask Question
12 August, 19:07

A particular competition has five judges, each of whom award a score between 0 and 10 to each performer. • Fractional scores, such as 8.3, are allowed. • A performer's final score is determined by dropping the highest and lowest score received, then averaging the three remaining scores. • Write a program that uses this method to calculate a contestant's score. It should include the following functions:

+5
Answers (1)
  1. 12 August, 19:27
    0
    Lets do this in python, our function will import an array of double numbers, then it sort the array out, drop the first and last items, aka highest and lowest score. Finally, it averages the last 3 numbers by calculate the sum and divide by the number of items

    def calculate_score (scores):

    scores. sort () # sort it so that the lowest is at index 0 and the highest is at last index

    drop_highest_lowest = scores[1:-1] # this will drop the lowest and highest number

    average_score = sum (drop_highest_lowest) / len (drop_highest_lowest)

    return average_score
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “A particular competition has five judges, each of whom award a score between 0 and 10 to each performer. • Fractional scores, such as 8.3, ...” in 📗 Engineering if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers