In: Computer Science
uestion: It’s that time again. Time for Mr. Brummett to calculate each student’s overall grade. However, i... 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
The code to do so is as follows:
Output:
if the answer helped you please upvote and in case you have some doubts please post a comment, i will surely help.
Code:
name = input("Enter the student name: ")
quizTotal = int(input("Enter the total possible quiz grade:
"))
quizWeight = float(input("Please enter quiz weight in decimal form:
"))
q1 = int(input("Please enter the first quiz grade: "))
q2 = int(input("Please enter the second quiz grade: "))
q3 = int(input("Please enter the third quiz grade: "))
q4 = int(input("Please enter the fourth quiz grade: "))
q5 = int(input("Please enter the fifth quiz grade: "))
q6 = int(input("Please enter the sixth quiz grade: "))
participationTotal = int(input("Enter the total possible
participation grade: "))
participationWeight = float(input("Please enter participation
weight in decimal form: "))
participation = int(input("Please enter the participation grade:
"))
projectTotal = int(input("Enter the total possible project grade:
"))
projectWeight = float(input("Please enter project weight in decimal
form: "))
p1 = int(input("Please enter the first project grade: "))
p2 = int(input("Please enter the second project grade: "))
p3 = int(input("Please enter the third project grade: "))
p4 = int(input("Please enter the fourth project grade: "))
p5 = int(input("Please enter the fifth project grade: "))
p6 = int(input("Please enter the sixth project grade: "))
testTotal = int(input("Enter the total possible test grade:
"))
testWeight = float(input("Please enter test weight in decimal form:
"))
t1 = int(input("Please enter the first test grade: "))
t2 = int(input("Please enter the second test grade: "))
t3 = int(input("Please enter the third test grade: "))
t4 = int(input("Please enter the fourth test grade: "))
quizGrade = ((q1+q2+q3+q4+q5+q6)/quizTotal)*quizWeight*100
participationGrade =
(participation/participationTotal)*participationWeight*100
projectGrade = ((p1+p2+p3+p4+p5+p6)/projectTotal)*projectWeight
*100
testGrade = ((t1+t2+t3+t4)/testTotal)*testWeight*100
totalGrade =
quizGrade+participationGrade+projectGrade+testGrade
gradeName = ""
if(totalGrade >=90 and totalGrade<=100):
gradeName = 'A'
elif (totalGrade >=80 and totalGrade<90):
gradeName = 'B'
elif (totalGrade >=70 and totalGrade<80):
gradeName ='C'
elif (totalGrade >=60 and totalGrade<70):
gradeName = 'D'
elif (totalGrade >=50 and totalGrade<60):
gradeName = 'E'
else:
gradeName = 'F'
print(f"{name}'s grades are: Overall Quiz Grade: {quizGrade}
Overall Participation Grade: {participationGrade} Overall Project
Grade: {projectGrade} Overall Test Grade:{testGrade} Final Grade:
{totalGrade} Your Grade: {gradeName} ")