Advertisement
aneliabogeva

Christmas_Market

Apr 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. import math
  2. money_needed = float(input())
  3.  
  4. number_fantasy_book = int(input())
  5. number_horror_book = int(input())
  6. numbe_romatic_book = int(input())
  7.  
  8. sum_fantasy = number_fantasy_book * 14.90
  9. sum_horro = number_horror_book * 9.80
  10. sum_romantic = numbe_romatic_book * 4.30
  11.  
  12. sum_book = sum_fantasy+sum_horro+sum_romantic
  13. total_sum = sum_book*0.80
  14.  
  15. if total_sum > money_needed:
  16. sum_salary = math.floor((total_sum-money_needed)*0.10)
  17. print(f"{(total_sum - sum_salary):.2f} leva donated.")
  18. print(f"Sellers will receive {sum_salary} leva.")
  19. else:
  20. print(f"{(money_needed-total_sum):.2f} money needed.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement