Advertisement
cardel

Reto 2 G29

Jun 14th, 2021
987
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.93 KB | None | 0 0
  1. import math
  2. def calcular_aportes(codigo_asociado:int, ingreso_mensual:float,
  3. num_anhos:int)-> dict:
  4.     smlv = 908526
  5.     num_sal = ingreso_mensual/smlv
  6.     porcentaje_cooperativa = 0
  7.     porcentaje_recreacion = 0
  8.  
  9.     #Aportes cooperativa
  10.     if num_sal <= 2:
  11.         porcentaje_cooperativa = 0.01
  12.     elif num_sal > 2 and num_sal <= 6:
  13.         porcentaje_cooperativa = 0.02
  14.     else:
  15.         porcentaje_cooperativa = 0.025
  16.  
  17.     #Aportes de recreación
  18.     if num_anhos <= 5:
  19.         porcentaje_recreacion = 0.0025
  20.     else:
  21.         porcentaje_recreacion = 0.003
  22.  
  23.     cuota_cooperativa = math.ceil(ingreso_mensual*porcentaje_cooperativa)
  24.     cuota_recreacion = math.ceil(ingreso_mensual*porcentaje_recreacion)
  25.  
  26.     return {"codigo-asociado":codigo_asociado,
  27.             "aporte-cooperativa":cuota_cooperativa,
  28.             "aporte-recreacion": cuota_recreacion,
  29.             "total-aportes":cuota_cooperativa+cuota_recreacion}
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement