Answer to Question #296321 in Python for cs3zj

Question #296321

For a certain academic subject the students are evaluated based on five tests -

  • Quiz 1 (20 marks - 10% Weight),
  • Quiz 2 (20 marks - 10% Weight),
  • Class test (50 marks - 25% Weight),
  • Assignment (100 marks - 25% weight) and
  • Project (200 marks - 30% weight).

Design a program that will prompt the user for marks for each of the tests and calculate the overall marks (out of 100).


1
Expert's answer
2022-02-11T07:44:03-0500
print("Enter the marks of five subjects::")


subject_1 = float (input ())
subject_2 = float (input ())
subject_3 = float (input ())
subject_4 = float (input ())
subject_5 = float (input ())


total, average, percentage, grade = None, None, None, None


# It will calculate the Total, Average and Percentage
total = subject_1 + subject_2 + subject_3 + subject_4 + subject_5
average = total / 5.0
percentage = (total / 500.0) * 100


if average >= 90:
    grade = 'A'
elif average >= 80 and average < 90:
    grade = 'B'
elif average >= 70 and average < 80:
    grade = 'C'
elif average >= 60 and average < 70:
    grade = 'D'
else:
    grade = 'E'

print ("\nThe Total marks is:   \t", total, "/ 500.00")
print ("\nThe Average marks is: \t", average)
print ("\nThe Percentage is:    \t", percentage, "%")
print ("\nThe Grade is:         \t", grade)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS