Question: Write a program that asks the user to enter a student's name and 8 numeric tests scores (out of 100 for each test). The name
Write a program that asks the user to enter a student's name and 8 numeric tests scores (out of 100 for each test). The name will be a local variable. The program should display a letter grade for each score, and the average test score, along with the student's name. There are 12 students in the class.
Write the following functions in the program:
calc_average - this function should accept 8 test scores as arguments and return the average of the scores per student
determine_grade - this function should accept a test score average as an argument and return a letter grade for the score based on the following grading scale:
Using python can you help me with the code. its suppose to print 12 stuents but stops after one .
def determine_grade(score): if score >=90: return 'A' elif score >=80 and score <90: return 'b' elif score>=70 and score <80: return 'c' elif score>=60 and score <70: return 'D' else: return 'F' def calc_average(scores): total = 0 for i in range(len(scores)): total = total + scores[i] return total/float(len(scores)) for i in range(12): scores = [] name = input("Enter the student name: ") for i in range(8): score = int(input("Enter the score: ")) scores.append(score) averageScore = calc_average(scores) print("Student Name: ", name) for i in range(len(scores)): print("Score: ",scores[i], "Letter Grade: ",determine_grade(scores[i])) print("Average Score: ", averageScore) Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
