Advertisement
fumanbest

Bonus Scoring System

Mar 14th, 2020
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. import math
  2. count_of_students = int(input())
  3. count_of_lectures = int(input())
  4. the_initial_bonus = int(input())
  5. maximum_bonus = 0
  6. total_bonus = 0
  7. attendance = 0
  8. for each in range(1, count_of_students+1):
  9.     attendances = int(input())
  10.     total_bonus = attendances / count_of_lectures * (5 + the_initial_bonus)
  11.     if total_bonus > maximum_bonus:
  12.         maximum_bonus = total_bonus
  13.         if maximum_bonus:
  14.             attendance = attendances
  15. print(f"Max Bonus: {math.ceil(maximum_bonus) }.")
  16. print(f"The student has attended {attendance} lectures.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement