0

Ive started with this program

def calcFinal():
while True:
try:
asg1Mark = int(raw_input("Enter Asg1 mark: "))
asg2Mark = int(raw_input("Enter Asg2 mark: "))
examMark = int(raw_input("Enter Exam mark: "))
final = asg1Mark + asg2Mark + examMark
return final
except ValueError:
print 'Please enter only numbers'


def mark_check(finalMark):
print "Final mark is %d, grade is" % finalMark,
if finalMark < 50:
print "Sorry, You have Fail"
elif finalMark <= 65:
print "You Passed. Well done"
elif finalMark <= 75:
print "You have earned a Credit :-) "
elif finalMark <= 85:
print "Distinction !!!"
elif finalMark >= 85:
print "Congrats you have earned an High Distinction"
else:
print "Invaild selction has been entered. Please try again"

def main():
finalMark = calcFinal()
mark_check(finalMark)

if __name__ == "__main__":
main()

A student MUST pass the final exam in order to pass the unit. Furthermore, if a student passes the exam, but fails the unit by not more than 5% of the total assessment, they are offered an AA – a chance to pass the unit by resubmitting an assignment and attaining a nominated standard.
Similarly, if a student fails the exam, but their total marks are within 5% of a passing grade, they are offered an AE – a chance to resit the exam and attain a passing grade.

What would be the best to approach this question
would it be to create another loop ??

Any help would be great

2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by woooee
0

At the very least you should test a program before posting the code here. If you test the code posted I think you will find that it does not work as one would expect it to.

if a student passes the exam, but fails the unit by not more than 5% of the total assessment,

You are going to find the difference between the student's grade and the total assessment.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.