Advertisement
Guest User

Untitled

a guest
May 1st, 2020
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.35 KB | None | 0 0
  1. #1.Input
  2. # 1.   Доход в лева - реално число;
  3. # 2.   Среден успех -  реално числсо;
  4. # 3.   Минимална работна заплата – реално число.
  5.  
  6. income=float(input())
  7. avgRes=float(input())
  8. minSal=float(input())
  9.  
  10. #2. CAlculate social scholarship = 35% от минималната работна заплата.
  11.  
  12. socialScholar=minSal*0.35
  13.  
  14. #3. Calculate scolar scholaship = - успехът на ученика, умножен по коефициент 25.
  15. scolarSchol=avgRes*25
  16.  
  17. #4: Check condition for which scolarship student will be receive:
  18.  
  19.  
  20.  
  21. getScolSchol = 'N'
  22. getSocialScholar = 'N'
  23.  
  24. # Изискване за стипендия за отличен успех - успех над 5.5, включително.
  25.  
  26. if avgRes>=5.5:
  27.     getScolSchol='Y'
  28.  
  29. # Изискване за социална стипендия - доход на член от семейството по-малък от минималната работна заплата и успех над 4.5.
  30.  
  31. if income<minSal and avgRes>4.5:
  32.     getSocialScholar='Y'
  33.  
  34.  
  35.  
  36.  
  37.  
  38.     # •    Ако ученикът има право да получава само социална стипендия:
  39.  
  40. if getSocialScholar=='Y' and getScolSchol!='Y':
  41.      print(f"You get a Social scholarship {int(socialScholar)} BGN")
  42.  
  43. elif getSocialScholar!='Y' and getScolSchol=='Y':
  44.      print(f"You get a scholarship for excellent results {int(scolarSchol)} BGN")
  45.  
  46. # •    Ако ученикът има право да получава само стипендия за отличен успех:
  47. # "You get a scholarship for excellent results {стойност на стипендията} BGN"
  48.  
  49.  
  50.  
  51.  
  52. # elif (getSocialScholar=='Y' and getScolSchol=='Y') and (scolarSchol<socialScholar):
  53. #     print(f"You get a Social scholarship {socialScholar:0.2f} BGN")
  54. # elif (getSocialScholar=='Y' and getScolSchol=='Y') and (scolarSchol>socialScholar):
  55. #     print(f"You get a scholarship for excellent results {scolarSchol:0.2f} BGN")
  56. #
  57.  
  58.  
  59.  
  60. elif getSocialScholar=='Y' and getScolSchol=='Y':
  61.     if scolarSchol>=socialScholar:
  62.         print(f"You get a scholarship for excellent results {int(scolarSchol)} BGN")
  63.     else:
  64.         print(f"You get a Social scholarship {int(socialScholar)} BGN")
  65. else:
  66.     print("You cannot get a scholarship!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement