Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Marks Calculator
#6
(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;
Reply


Messages In This Thread
Marks Calculator - by azure - Apr-24-2020, 07:12 AM
RE: Marks Calculator - by buran - Apr-24-2020, 07:26 AM
RE: Marks Calculator - by azure - Apr-24-2020, 08:12 AM
RE: Marks Calculator - by buran - Apr-24-2020, 07:43 AM
RE: Marks Calculator - by buran - Apr-24-2020, 08:19 AM
RE: Marks Calculator - by azure - Apr-24-2020, 09:45 AM
RE: Marks Calculator - by anbu23 - Apr-24-2020, 10:49 AM
RE: Marks Calculator - by azure - Apr-24-2020, 11:42 AM
RE: Marks Calculator - by deanhystad - Apr-25-2020, 12:32 PM
RE: Marks Calculator - by azure - Apr-25-2020, 12:43 PM
RE: Marks Calculator - by azure - Apr-26-2020, 08:21 AM
RE: Marks Calculator - by anbu23 - Apr-25-2020, 12:38 PM
RE: Marks Calculator - by anbu23 - Apr-26-2020, 10:58 AM
RE: Marks Calculator - by azure - Apr-27-2020, 12:29 AM
For Loop and while - by azure - Apr-25-2020, 11:49 AM
RE: For Loop and while - by anbu23 - Apr-25-2020, 12:05 PM
RE: For Loop and while - by azure - Apr-25-2020, 12:28 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020