It’s that time again. Time for Mr. Brummett to calculate each student’s overall grade. However, it’s much easier to do it in Python. In this assignment your goal is to write a python program called grade.py that takes in the student’s name, 6 quiz grades, 4 test grades, 6 project grades, and a participation grade. The program should also take in the weighted percentage of each type of assignment (for example Participation is usually 5% of the total grade) as a floating type (.5). It should then print out the student name, each calculated grade for each assignment type and the final overall grade. Guidelines: • All inputs should be taken from the user. • Get and return the overall grade for each assignment type (Tests, Projects, Quizzes, and Participation). This means the program will have to get the max overall points for the assignment type (say quizzes are 10 points apiece so 6*10=60). The number of points for each individual assignment of that type. For example, in quiz the user should be prompted 6 times and these 6 numbers should be added together. • The test cases use a 30% weighted total for Tests, a 15% weighted total for Quizzes, 5% weighted total for Participation, 50% weighted total for Projects. • Use if, elif, and else statements to print a letter grade based on the final grade. Sample Output: Enter Student Name:Jon Doe Please enter the total possible quiz grade:60 Please enter quiz weight in decimal form:.15 Please enter the first quiz grade:10 Please enter the second quiz grade:5 Please enter the third quiz grade:6 Please enter the fourth quiz grade:7 Please enter the fifth quiz grade:10 Please enter the sixth quiz grade:9 Please enter the total possible Participation grade:100 Please enter participation weight in decimal form:.05 Please enter the Participation grade:100 Please enter the total possible project grade:600 Please enter project weight in decimal form:.50 Please enter the first project grade:100 Please enter the second project grade:100 Please enter the third project grade:90 Please enter the fourth project grade:80 Please enter the fifth project grade:80 Please enter the sixth project grade:50 Please enter the total possible test grade:400 Please enter test weight in decimal form:.30 Please enter the first test grade:100 Please enter the second test grade:90 Please enter the third test grade:80 Please enter the fourth test grade:50 Jon Doe's grades are: Overall Quiz Grade: 11.75 Overall Participation Grade: 5.0 Overall Project Grade: 41.66666666666667 Overall Test Grade: 24.0 Final Grade: 82.41666666666667 Your Grade: B
HOPE THIS
ANSWER SATISFIES YOUR QUERY. IF I MISSED SOMETHING PLEASE DO
MENTION IN THE COMMENTS AND ALSO PLEASE RATE THE ANSWER. I HAVE
ALSO ATTACHED THE SCREENSHOT OF THE CODE FOR BETTER
UNDERSTANDING.
THANKS
name = str(input("Enter student name: "))
totalQuiz = int(input("Please enter total possible quiz grade:
"))
Wquiz = float(input("Enter quiz weight in decimal form: "))
quiz = []
for i in range(0,6): #for loop for input of values of quiz
marks = int(input("Please enter the " + str(i+1) + " quiz grade:
"))
quiz.append(marks)
totalpart = int(input("Please enter total possible participation
grade: "))
Wpart = float(input("Enter participation weight in decimal form:
"))
marksPart = int(input("Please enter the participation grade:
"))
totalproject = int(input("Please enter total possible project
grade: "))
Wproject = float(input("Enter project weight in decimal form:
"))
project = []
for i in range(0,6): #for loop for input of values of project
marks = int(input("Please enter the " + str(i+1) + " project grade:
"))
project.append(marks)
totaltest = int(input("Please enter total possible test grade:
"))
Wtest = float(input("Enter test weight in decimal form: "))
test = []
for i in range(0,4): #for loop for input of values of test
marks = int(input("Please enter the " + str(i+1) + " test grade:
"))
test.append(marks)
##OVERALL CALCULATION
OvrllQ = sum(quiz)/totalQuiz * Wquiz
OvrllPart = (marksPart/totalpart) * Wpart
OvrllPrj = (sum(project)/totalproject) * Wproject
OvrllT = (sum(test)/totaltest) * Wtest
#FINAL CALCULATION
finalG = (OvrllQ + OvrllPart + OvrllPrj + OvrllT)*100
print(name + "'s grades are: \n")
print("Overall Quiz Grade: " + str(OvrllQ*100))
print("Overall Participation Grade: " + str(OvrllPart*100))
print("Overall Project Grade: " + str(OvrllPrj*100))
print("Overall test Grade: " + str(OvrllT*100))
print("Final Grade: " + str(finalG*100))
#GRADE ASSIGNMENT. YOU CAN CHANGE VALUES IN IF ELSE STATEMENT
ACCORDING TO YOUR GRADE PREFERENCE
if finalG > 90:
print("Your Grade: A")
elif (finalG > 80 and finalG < 90):
print("Your Grade: B")
elif (finalG > 70 and finalG < 80):
print("Your Grade: C")
elif (finalG > 60 and finalG < 70):
print("Your Grade: D")
else:
print("Your Grade: F")
Get Answers For Free
Most questions answered within 1 hours.