(Apr-24-2020, 08:19 AM)buran Wrote: [ -> ]77 is meaningless as number, because you basically sum apples and pears - as I noted the components have different max points - 10, 100, 150.
so, you need to calculate each component as percent of maximum points for that component.
0.1*0.7 + 0.2*0.56 + 0.7*0.62 = 0.616 or 61.6% rounded up to 62 out of 100
with 77 you can get close too - max points you can get is 0.1*10+0.2*100+0.7*150 = 126, so you have 77/126 ~ 0.611111111 or 61.1% ~ 61 out 100. But that is just approximation, the correct calculation is to work with percents as above
I got it!
Thank you so much, Buran!
I got another question for you. Sorry, I am still a newbie in Python.
So, I need to code that formula in Python now. This is my try, does it make sense?
While True:
print(“Welcome to the Marks Calculator! “)
studentID = int(input(“Enter Student ID >> “))
print(“Enter Student ID >> “ + studentID”)
atMark = int(input(“Enter Assessable Tutorial mark (/10) >> “))
print(“Enter Assessable Tutorial mark (/10) >> “ + atMark”)
asMark = int(input(“Enter Assignment mark (/100) >> “))
print(“Enter Assignment mark (/100) >> “ + asMark)
exMark = int(input(“Enter Exam mark (/150) >> “))
print((“Enter Exam mark (/150) >> “ + exMark)
exam = 0.7
assignment = 0.2
tutorial = 0.1
finalGrade = float(tutorial*10+assignment*100+exam*150)/ atMark*tutorial+asMark*assigment+exMark*exam)
print(“Student ID: “ + studentID, “Final Mark: “ + finalGrade)
proceed = input(“Would you like to process another student’s marks? (y/n) >> ”)
if proceed.upper() != “Y”:
print(You have processed the following students: “)
-----------------------------
I don’t know how to create a column with the StudentID and the FinalMark in this part….
print(“Program has terminated, goodbye!”)
break;