I have a zyBooks question that I'm stuck on.
The following program calculates an overall grade in a course based on three equally weighted exams.
then provides this code:
exam1_grade = float(input('Enter score on Exam 1 (out of 100):\n'))
exam2_grade = float(input('Enter score on Exam 2 (out of 100):\n'))
exam3_grade = float(input('Enter score on Exam 3 (out of 100):\n'))
overall_grade = (exam1_grade + exam2_grade + exam3_grade) / 3
print('Your overall grade is:', overall_grade)
then these questions.
Calculates the overall grade for four equally weighted programming assignments, where each assignment is graded out of 50 points. Hint: First calculate the percentage for each assignment (e.g., score / 50), then calculate the overall grade percentage (be sure to multiply the result by 100).
Calculates the overall grade for four equally weighted programming assignments, where assignments 1 and 2 are graded out of 50 points and assignments 3 and 4 are graded out of 75 points.
Calculates the overall grade for a course with three equally weighted exams (graded out of 100) that account for 60% of the overall grade and four equally weighted programming assignments (graded out of 50) that account for 40% of the overall grade. Hint: The overall grade can be calculated as 0.6 * averageExamScore + 0.4 * averageProgScore.
I (believe) I've got the first two questions, but I'm stuck on the last one. Putting in input that should result in a score of 100, I get 2.7, so it's giving me a result that's way too low. Can anyone help me figure out what I'm doing wrong?
exam2_grade = float(input('Enter score on Exam 2 (out of 100):\n'))
exam3_grade = float(input('Enter score on Exam 3 (out of 100):\n'))
overall_grade = (exam1_grade + exam2_grade + exam3_grade) / 3
print('Your overall grade is:', overall_grade)
assignment1_grade = int(input('Enter score on Assignment 1 (out of 50):\n'))
assignment2_grade = int(input('Enter score on Assignment 2 (out of 50):\n'))
assignment3_grade = int(input('Enter score on Assignment 3 (out of 50):\n'))
assignment4_grade = int(input('Enter score on Assignment 4 (out of 50):\n'))
assignment1_prc = (assignment1_grade / 50)
assignment2_prc = (assignment2_grade / 50)
assignment3_prc = (assignment3_grade / 50)
assignment4_prc = (assignment4_grade / 50)
overall_avg = (((assignment1_prc + assignment2_prc + assignment3_prc + assignment4_prc) / 4) * 100)
print('Your overall grade is:', overall_avg)
assignment1_grade = int(input('Enter score on Assignment 1 (out of 50):\n'))
assignment2_grade = int(input('Enter score on Assignment 2 (out of 50):\n'))
assignment3_grade = int(input('Enter score on Assignment 3 (out of 75):\n'))
assignment4_grade = int(input('Enter score on Assignment 4 (out of 75):\n'))
assignment1_prc = (assignment1_grade / 50)
assignment2_prc = (assignment2_grade / 50)
assignment3_prc = (assignment3_grade / 75)
assignment4_prc = (assignment4_grade / 75)
overall_avg = (((assignment1_prc + assignment2_prc + assignment3_prc + assignment4_prc) / 4) * 100)
print('Your overall grade is:', overall_avg)
exam1_grade = int(input('Enter score on Exam 1 (out of 100):\n'))
exam2_grade = int(input('Enter score on Exam 2 (out of 100):\n'))
exam3_grade = int(input('Enter score on Exam 3 (out of 100):\n'))
assignment1_grade = int(input('Enter score on Assignment 1 (out of 50):\n'))
assignment2_grade = int(input('Enter score on Assignment 2 (out of 50):\n'))
assignment3_grade = int(input('Enter score on Assignment 3 (out of 50):\n'))
assignment4_grade = int(input('Enter score on Assignment 4 (out of 50):\n'))
exam1_prc = exam1_grade / 100
exam2_prc = exam2_grade / 100
exam3_prc = exam3_grade / 100
assignment1_prc = assignment1_grade / 50
assignment2_prc = assignment2_grade / 50
assignment3_prc = assignment3_grade / 50
assignment4_prc = assignment4_grade / 50
averageExamScore = (exam1_prc + exam2_prc + exam3_prc / 3)
averageProgScore = (assignment1_prc + assignment2_prc + assignment3_prc + assignment4_prc / 4)
overall_avg = ((0.6 * averageExamScore) + (0.4 * averageProgScore))
print('Your overall grade is', overall_avg)