Sichanov

08_sholarship

Nov 8th, 2020
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.48 KB | None | 0 0
  1. incoming = float(input())
  2. grade = float(input())
  3. min_salary = float(input())
  4. social_scholarship = int(min_salary * 0.35)  # math.floor може да се ползва
  5. excellent_scholarship = int(grade * 25)
  6.  
  7. # 1. Успех над 5.50 включително.
  8. if grade >= 5.50:
  9.  
  10. # 1.1 Социалната стипендия е по-висока и има право на нея - даваме социална стипендия.
  11.     if social_scholarship > excellent_scholarship and incoming < min_salary:
  12.         print(f"You get a Social scholarship {social_scholarship} BGN")
  13. # 1.2 Взима стипендия за отличен успех - даваме стипендия за отличен успех.
  14.     else:
  15.         print(f"You get a scholarship for excellent results {excellent_scholarship} BGN")
  16. # 2. Успех над 4.50 и по-малък от 5.50.
  17. elif 4.50 < grade < 5.50:  # elif grade < 4.50:
  18.  
  19. # 2.1 Ако има право на социалната стипендия я даваме.
  20.     if incoming < min_salary:
  21.         print(f"You get a Social scholarship {social_scholarship} BGN")
  22. # 2.2 Ако няма право на социална стипендия отпечатваме, че не взима нищо.
  23.     else:
  24.         print("You cannot get a scholarship!")
  25. # 3. Успех по-малък или равен на 4.50 - отпечатваме, че не взима нищо
  26. elif grade <= 4.50:  #else:
  27.     print("You cannot get a scholarship!")
  28.  
Add Comment
Please, Sign In to add comment