Advertisement
Bit1

Untitled

May 8th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.33 KB | None | 0 0
  1. def main():
  2.     student_ID = int(input("Please enter the student ID:"))
  3.     studentName = (input ("Please enter the student name:"))                
  4.     a1_Mark = float(input ("Please enter the marks for Assignment 1:"))
  5.     a1_Weightedmark = a1_Mark * 20/100
  6.  
  7.     a2_Mark = float(input ("Please enter the marks for Assignment 2:"))
  8.     a2_Weightedmark = a2_Mark * 30/100
  9.  
  10.     fe_Mark = float(input ("Please enter the marks for the Final Exam:"))
  11.     fe_Weightedmark = fe_Mark * 50/100
  12.  
  13.     total_Aweightedmarks = a1_Weightedmark + a2_Weightedmark
  14.     total_Weightedmark = total_Aweightedmarks + fe_Weightedmark
  15.  
  16.     #find the bonus points and add them on to total mark.
  17.     if total_Weightedmark >=50 and total_Weightedmark <=70:
  18.         bonusCalc = total_Weightedmark - 50
  19.         bonus_marks = bonusCalc *10/100
  20.         total = total_Weightedmark + bonus_marks
  21.    
  22.     elif total_Weightedmark >=70 and total_Weightedmark <=90:
  23.         bonusCalc = total_Weightedmark - 70
  24.         bonus_marks = bonusCalc *15/100 + 2
  25.         total = total_Weightedmark + bonus_marks
  26.  
  27.     elif total_Weightedmark >=90 and total_Weightedmark <=100:
  28.         bonusCalc = total_Weightedmark - 90
  29.         bonus_marks = bonusCalc *20/100 + 5
  30.         total = total_Weightedmark + bonus_marks
  31.  
  32.     else:
  33.         bonus_marks = 0
  34.         total = total_Weightedmark
  35.     if total >100:
  36.       total = 100
  37.  
  38.     print ("Thank You!")
  39.  
  40.  
  41.     print ("Weighted mark for Assignment 1:")
  42.     print (a1_Weightedmark)
  43.  
  44.     print ("Weighted mark for Assessment 2:")
  45.     print (a2_Weightedmark)
  46.  
  47.     print ("Total weighted mark of the assignments:")
  48.     print (total_Aweightedmarks)
  49.  
  50.     print ("Weighted mark for the Final Exam is:")
  51.     print (fe_Weightedmark)
  52.  
  53.     print ("Total weighted mark for the subject:")
  54.     print (total_Weightedmark)
  55.  
  56.     print ("Bonus points:")
  57.     print (bonus_marks)
  58.  
  59.     print ("Total mark with bonus:")
  60.     print (total)
  61.  
  62.  
  63. def menu():
  64.     y = main()
  65.     n = print("Goodbye")
  66.     menu = str(input("Do you want to enter another student Y/N?"))
  67.     if menu == 'y':
  68.        main()
  69.     else:
  70.         menu == 'n'
  71.         print("Goodbye")
  72.     while menu == 'y':
  73.         menu = str(input("Do you want to enter another student Y/N?"))
  74.         main()
  75.     else:
  76.         while menu == 'n':
  77.             print("Goodbye")
  78.  
  79. menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement