shivajikobardan
Junior Member
- Joined
- Nov 1, 2021
- Messages
- 107
The solution code is like this-:
I don't understand how we calculated exams_total, activities_total and sports_total here? What was the logic used for that? Do we have any other ways of solving this problem? I know this is too basic question. But I got really confused.
this is the logic that i want to be able to use and that i think is right, but i am not sure how i apply this in program....this looks too confusing for me..
total marks=50% of marks in 2 exams+20% of marks in 1 sports event+30% of marks in 3 activities?
Python:
ACTIVITIES_WEIGHTAGE=30.0
SPORTS_WEIGHTAGE=20.0
EXAMS_WEIGHTAGE=50.0
EXAMS_TOTAL=200.0
ACTIVITIES_TOTAL=60.0
SPORTS_TOTAL=50.0
exam_score1=int(input("Enter marks in first examinations out of 100"))
exam_score2=int(input("Enter marks in second examinations out of 100"))
sports_score=int(input("Enter marks in sports out of 50"))
activities_score1=int(input("Enter marks in first activity out of 20"))
activities_score2=int(input("Enter marks in second activity out of 20"))
activities_score3=int(input("Enter marks in third activity out of 20"))
exam_total=exam_score1+exam_score2
activities_total=activities_score1+activities_score2+activities_score3
exam_percent=float(exam_total*EXAMS_WEIGHTAGE/EXAMS_TOTAL)
sports_percent=float(sports_score*SPORTS_WEIGHTAGE/SPORTS_TOTAL)
activities_percent=float(activities_total*ACTIVITIES_WEIGHTAGE/ACTIVITIES_TOTAL)
total_percent=exam_percent+sports_percent+activities_percent
print("Total percentage=",total_percent)
I don't understand how we calculated exams_total, activities_total and sports_total here? What was the logic used for that? Do we have any other ways of solving this problem? I know this is too basic question. But I got really confused.
this is the logic that i want to be able to use and that i think is right, but i am not sure how i apply this in program....this looks too confusing for me..
total marks=50% of marks in 2 exams+20% of marks in 1 sports event+30% of marks in 3 activities?