Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- student_ID = int(input("Please enter the student ID:"))
- studentName = (input ("Please enter the student name:"))
- a1_Mark = float(input ("Please enter the marks for Assignment 1:"))
- a1_Weightedmark = a1_Mark * 20/100
- a2_Mark = float(input ("Please enter the marks for Assignment 2:"))
- a2_Weightedmark = a2_Mark * 30/100
- fe_Mark = float(input ("Please enter the marks for the Final Exam:"))
- fe_Weightedmark = fe_Mark * 50/100
- total_Aweightedmarks = a1_Weightedmark + a2_Weightedmark
- total_Weightedmark = total_Aweightedmarks + fe_Weightedmark
- #find the bonus points and add them on to total mark.
- if total_Weightedmark >=50 and total_Weightedmark <=70:
- bonusCalc = total_Weightedmark - 50
- bonus_marks = bonusCalc *10/100
- total = total_Weightedmark + bonus_marks
- elif total_Weightedmark >=70 and total_Weightedmark <=90:
- bonusCalc = total_Weightedmark - 70
- bonus_marks = bonusCalc *15/100 + 2
- total = total_Weightedmark + bonus_marks
- elif total_Weightedmark >=90 and total_Weightedmark <=100:
- bonusCalc = total_Weightedmark - 90
- bonus_marks = bonusCalc *20/100 + 5
- total = total_Weightedmark + bonus_marks
- else:
- bonus_marks = 0
- total = total_Weightedmark
- if total >100:
- total = 100
- print ("Thank You!")
- print ("Weighted mark for Assignment 1:")
- print (a1_Weightedmark)
- print ("Weighted mark for Assessment 2:")
- print (a2_Weightedmark)
- print ("Total weighted mark of the assignments:")
- print (total_Aweightedmarks)
- print ("Weighted mark for the Final Exam is:")
- print (fe_Weightedmark)
- print ("Total weighted mark for the subject:")
- print (total_Weightedmark)
- print ("Bonus points:")
- print (bonus_marks)
- print ("Total mark with bonus:")
- print (total)
- def menu():
- y = main()
- n = print("Goodbye")
- menu = str(input("Do you want to enter another student Y/N?"))
- if menu == 'y':
- main()
- else:
- menu == 'n'
- print("Goodbye")
- while menu == 'y':
- menu = str(input("Do you want to enter another student Y/N?"))
- main()
- else:
- while menu == 'n':
- print("Goodbye")
- menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement