Question

Many classes calculate a final grade by using a weighted scoring system. For example, “Assignments” might...

Many classes calculate a final grade by using a weighted scoring system. For example, “Assignments” might be worth 40% of your final grade. To calculate the grade for the Assignments category, the teacher takes the percentage earned on the assignments and multiplies it by the weight. So if the student earned a 90% total on the Assignments, the teacher would take 90% x 40, which means the student earned a 36 percent on the Assignments section. The teacher then calculates the grade in the other categories (Quizzes, Midterm Exam, Final Exam, etc.) and sums the grades earned in each to come up with the Final Score, and assigns a letter grade based on that score.

Write Python pseudocode that allows the teacher to calculate the grade for a student. The teacher will first enter the Student ID number, first name, and last name. This information will be followed by entering in the score for each of the following categories: Assignments, Quizzes, Midterm Exam, & Final Exam

The weights for each category are as follows:

Assignments - 50%
Quizzes – 15%
Midterm – 15%
Final – 20%

Once you have the scores for each individual category, calculate a total score for the course. Then assign a letter grade to the student based on the following grade scale:

90 – 100 = A
80 – 90 = B
70 – 80 = C
60 – 70 = D
< 60 = E

Print the results in exactly the following format:

[Last Name], [First Name]
Student ID: [Student ID]
Assignments: [Assignment Score]
Quizzes: [Quizzes Score]
Midterm: [Midterm Score]
Final: [Final Score]
Total Score: [Total Score]             Grade: [Letter Grade]

Then ask the user if they would like to enter another student or quit. Continue the process until the user chooses to quit.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The code is commented for understanding

CODE:

# Weight of the exams
assign_weight = .5
quiz_weight = .15
mid_weight = .15
finals_weight = .2

repeat = 'y'

while(repeat == 'y'):
# Take user input
sid = input('Student Id: ')
first = input('First Name: ')
last = input('Last Name: ')
assign = float(input('Assignment Score: '))
quiz = float(input('Quizzes Score: '))
mid = float(input('Midterm Exam Score: '))
finals = float(input('Final Exam Score: '))

# Calculate total score
score = assign * assign_weight + quiz * quiz_weight + mid * mid_weight + finals * finals_weight

# Calculate grade
grade = None
if score > 90:
grade = 'A'
elif score <= 90 and score > 80:
grade = 'B'
elif score <= 80 and score > 70:
grade = 'C'
elif score <= 70 and score > 60:
grade = 'D'
else:
grade = 'E'

print(last, first, sep=", ")
print("Student ID: ", sid)
print("Assignments: ", assign)
print("Quizzes: ", quiz)
print("Midterm: ", mid)
print("Final: ", finals)
print("Total Score: ", score, '\t', "Grade: ", grade)

# Take user input to repeat the score calculation
repeat = input('Do you want to enter another student (y/n)')
if(repeat == 'y' or repeat == 'Y'):
continue
else:
break

Screenshots:


Output:

Add a comment
Know the answer?
Add Answer to:
Many classes calculate a final grade by using a weighted scoring system. For example, “Assignments” might...
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 grading program for the following grading policies:- a. There are two quizzes, each graded...

    Write a grading program for the following grading policies:- a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, each graded on the basis of 100 points. c. The final exam counts for 50 percent of the grade, the midterm counts for 25 percent and the two quizzes together count for a total of 25 percent. Grading system is as follows:- >90 A >=80 and <90 B...

  • The grade for the Fin 308 course is determined by the weighted average of the following...

    The grade for the Fin 308 course is determined by the weighted average of the following grade categories: Midterm exam 35% Final exam 35% Quiz 6% Homework in Connect 14% Data analysis assignments 10% Bloomberg BMC (extra credit) maximum 3 pts Student X had 65 on the midterm, 90 on the quiz, 85 on Connect homework, 80 on the data analysis assignment and 2 extra point from BMC. If the student wants to get a B, his weighted average needs...

  • A student's course grade is based on one midterm that counts as 20% of his final...

    A student's course grade is based on one midterm that counts as 20% of his final grade, one class project that counts as 10% of his final grade, a set of homework assignments that counts as 45% of his final grade, and a final exam that counts as 25% of his final grade. His midterm score is 81, his project score is 93, his homework score is 93, and his final exam score is 70. What is his overall final...

  • In C Langage Write a grading program for a class with the following grading policies:- a. There are two quizzes, each gr...

    In C Langage Write a grading program for a class with the following grading policies:- a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, each graded on the basis of 100 points. c. The final exam counts for 50 percent of the grade, the midterm counts for 25 percent and the two quizzes together count for a total of 25 percent. Grading system is as follows:-...

  • A​ student's course grade is based on one midterm that counts as 20​% of his final​...

    A​ student's course grade is based on one midterm that counts as 20​% of his final​ grade, one class project that counts as 25​% of his final​ grade, a set of homework assignments that counts as 45​% of his final​ grade, and a final exam that counts as 10​% of his final grade. His midterm score is 60​, his project score is 90​, his homework score is 92​, and his final exam score is 78. What is his overall final​...

  • A​ student's course grade is based on one midterm that counts as 15​% of his final​...

    A​ student's course grade is based on one midterm that counts as 15​% of his final​ grade, one class project that counts as 5​% of his final​ grade, a set of homework assignments that counts as 45​% of his final​ grade, and a final exam that counts as 35​% of his final grade. His midterm score is 72​, his project score is 96​, his homework score is 89​, and his final exam score is 66. What is his overall final​...

  • A​ student's course grade is based on one midterm that counts as 2020​% of his final​...

    A​ student's course grade is based on one midterm that counts as 2020​% of his final​ grade, one class project that counts as 2020​% of his final​ grade, a set of homework assignments that counts as 4545​% of his final​ grade, and a final exam that counts as 1515​% of his final grade. His midterm score is 8080​, his project score is 8282​, his homework score is 8484​, and his final exam score is 6363. What is his overall final​...

  • A​ student's course grade is based on one midterm that counts as 10% of his final​...

    A​ student's course grade is based on one midterm that counts as 10% of his final​ grade, one class project that counts as 10​% of his final​ grade, a set of homework assignments that counts as 35​% of his final​ grade, and a final exam that counts as 4545​% of his final grade. His midterm score is 65 his project score is 92 his homework score is 89 and his final exam score is 60. What is his overall final​...

  • A​ student's course grade is based on one midterm that counts as 1010​% of his final​...

    A​ student's course grade is based on one midterm that counts as 1010​% of his final​ grade, one class project that counts as 1515​% of his final​ grade, a set of homework assignments that counts as 4545​% of his final​ grade, and a final exam that counts as 3030​% of his final grade. His midterm score is 6969​, his project score is 9494​, his homework score is 9292​, and his final exam score is 6767. What is his overall final​...

  • using if/switch statements (C++) Write a grading program for a class with the following grading policies:...

    using if/switch statements (C++) Write a grading program for a class with the following grading policies: There are two quizzes, each graded on the basis of 10 points There is one midterm exam and one final exam, each graded on the basis of 100 points The final exam counts for 50% of the grade, the midterm counts for 25% and the two quizzes together count for a total of 25%. (Do not forget to normalize the quiz scores. They should...

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
ADVERTISEMENT