Question

PHYTHON NOT JAVA!!! need HELP ASAP!!! This program gets a series of test scores and #...

PHYTHON NOT JAVA!!!
need HELP ASAP!!!
This program gets a series of test scores and
# calculates the average of the scores with the
# lowest score dropped.


def main():
# Get the test scores from the user and store it in a variable called scores.
  

# Get the total of the test scores and store it in a variable called total.
  

# DONE - Get the lowest test score and store it in a variable called lowest.
lowest = min(scores)

# Subtract the lowest score from the total.
  


# DONE - Calculate the average. Note that we divide
# by 1 less than the number of scores because
# the lowest score was dropped.
average = total / (len(scores) - 1)


# Display the average with appropriate description.
  


# The get_scores function gets a series of test
# scores from the user and stores them in a list.
# A reference to the list is returned.
def get_scores():
# Create an empty list called test_scores.
  
  
# DONE - Create a variable to control the loop.
again = 'y'

# Now to Get the scores from the user and add them to
# the list.
while again == 'y':
# Ask the user for a score and convert into a real number, store it in a variable called value.
  

# append the value to the list.
  

# Ask the user if they are more scores to be added to the list
  
#update the 'again' variable with their response, they should know that
# y would contine loop, anything else would end it,
again =

#DONE - print an empty line
print()
  
# Return the list.
  

# The get_total function accepts a list as an
# argument returns the total of the values in
# the list.
def get_total(value_list):
# DONE - Create a variable to use as an accumulator.
total = 0.0
  
# Calculate the total of the list of values .
  



# Return the accumulated total.
  


# Call the main function.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

def main():

scores = get_scores()

total = get_total(scores)

lowest = min(scores)

total -= lowest

average = total / (len(scores) - 1)

print("Average without the smallest =", average)

def get_scores():

test_scores = []

again = 'y'

while again == 'y':

value = int(input("Enter a score: "))

test_scores.append(value)

again = input("Would you like to enter again (y/n)?: ")

if again == 'n':

break

print()

return test_scores

def get_total(value_list):

total = 0.0

for one in value_list:

total += one

return total

main()

''' OUTPUT

Enter a score: 10

Would you like to enter again (y/n)?: y

Enter a score: 8

Would you like to enter again (y/n)?: y

Enter a score: 6

Would you like to enter again (y/n)?: n

Average without the smallest = 9.0

'''

# Hit the thumbs up if you are fine with the answer. Happy Learning!

Add a comment
Know the answer?
Add Answer to:
PHYTHON NOT JAVA!!! need HELP ASAP!!! This program gets a series of test scores and #...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a Python program that asks the user to type in their three quiz scores (scores...

    Write a Python program that asks the user to type in their three quiz scores (scores between 0 and 100) and displays two averages. The program should be written so one function gets the user to input a score, another function takes the three scores and returns the average of them. And another function takes the three scores and averages the two highest scores (in other words, drops the lowest). Each of these functions should do the computation and return...

  • I need help with this c++ question please thank you ltls. The program should urt valte....

    I need help with this c++ question please thank you ltls. The program should urt valte. 11. Lowest Score Drop Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions: void getscore() should ask the user for a test score, store it in a reference param- eter variable, and validate it. This function should be called by main once for each of...

  • c++ Instructions Overview In this programming challenge you will create a program to handle student test...

    c++ Instructions Overview In this programming challenge you will create a program to handle student test scores.  You will have three tasks to complete in this challenge. Instructions Task 1 Write a program that allocates an array large enough to hold 5 student test scores. Once all the scores are entered, the array should be passed to a function that sorts them in ascending order. Another function should be called that calculates the average score. The program should display the...

  • Write a program that will ask the user to enter 4 quiz scores. These scores should...

    Write a program that will ask the user to enter 4 quiz scores. These scores should be from 0 to 100. Use a procedure and pass by reference to get these scores. Write a function that will find the lowest score. This score will be sent back through the function call. You still need to pass the scores by value to this function. Write a function that will calculate the average score. This value will be sent back to main...

  • Lowest Score Drop In Functions, there can only be one return statement. You can not use...

    Lowest Score Drop In Functions, there can only be one return statement. You can not use an exit or break function. Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions: void getScore() should ask the user for a test score, store it in a reference parameter variable, and validate it. This function should be called by main once for each of...

  • Complete the following Java class. In this class, inside the main() method, user first enters the...

    Complete the following Java class. In this class, inside the main() method, user first enters the name of the students in a while loop. Then, in an enhanced for loop, and by using the method getScores(), user enters the grades of each student. Finally, the list of the students and their final scores will be printed out using a for loop. Using the comments provided, complete the code in methods finalScore(), minimum(), and sum(). import java.util.Scanner; import java.util.ArrayList; public class...

  • Please help with PYTHON exercise 1 below: Write a program Sores.py to process a student's homework...

    Please help with PYTHON exercise 1 below: Write a program Sores.py to process a student's homework scores. Ask user to enter the homework scores for a student and save the scores in a list. Loop through the list to find the total score and the lowest score. (Do not use built-in function, sum and min. You need to write a loop to process the scores). Calculate the raw average score and modified average score (after dropping the lowest score). Print...

  • Write a program that allows the user to enter a series of exam scores. The number...

    Write a program that allows the user to enter a series of exam scores. The number of scores the user can enter is not fixed; they can enter any number of scores they want. The exam scores can be either integers or floats. Then, once the user has entered all the scores they want, your program will calculate and print the average of those scores. After printing the average, the program should terminate. You need to use a while loop...

  • ***NEED SOLUTION IN PYTHON *** 1. Create a main function which only gets executed when the...

    ***NEED SOLUTION IN PYTHON *** 1. Create a main function which only gets executed when the file is directly executed Hint: def main(): pass if __name__ == '__main__': main() 2. Your programs will use a file called scores.txt to store a bunch of user-provided numbers. These can be int or float but their values must be between 0 and 100. Inside the main function, display the current list of numbers to the user and ask if they want to update...

  • In Java Main method Your main program will prompt the user for a test name and...

    In Java Main method Your main program will prompt the user for a test name and the number of scores the user will enter. After creating an arraylist to hold the scores, prompt the user for all the scores to hold in the arraylist. After all the scores are entered, then repeat back the score & letter grade. GradeBook Object Create an instance of a GradeBook object and pass the test name and arraylist to set the instance variables. At...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT