# Parcial
SENCILLA = 20000
DOBLE = 25000
TRIPLE = 28000
RECARGO_TARJETA = 0.07
DESCUENTO_EFECTIVO = 0.05
DESCUENTO_CANTIDAD = 0.03
IVA = 0.19
#print(47600 * RECARGO_TARJETA )
#Entradas
numero_de_hamburguesas_uno = 2
tipo_de_hamburguesas_uno = "Sencilla"
tipo_de_pago_uno = "Tarjeta Credito"
numero_de_hamburguesas_dos = 3
tipo_de_hamburguesas_dos = "Doble"
tipo_de_pago_dos = "Efectivo"
numero_de_hamburguesas_tres = 11
tipo_de_hamburguesas_tres = "Triple"
tipo_de_pago_tres = "Tarjeta Debito"
def precio_unitario_tipo_hamburguesa(tipo_hamburguesa):
if tipo_hamburguesa == "Sencilla":
return SENCILLA
elif tipo_hamburguesa == "Doble":
return DOBLE
else:
return TRIPLE
def porcentaje_recargo(tipo_pago):
if tipo_pago == "Tarjeta Credito":
return RECARGO_TARJETA
else:
return 0
def descuento_efectivo(tipo_pago):
if tipo_pago == "Efectivo":
return DESCUENTO_EFECTIVO
else:
return 0
def descuento_cantidad(numero_hamburguesas):
if numero_hamburguesas > 10:
return DESCUENTO_CANTIDAD
else:
return 0
def calcular_pedido(numero_hamburguesas, tipo_hamburguesa, tipo_pago):
precio = precio_unitario_tipo_hamburguesa(tipo_hamburguesa)
total_sin_recargo = precio * numero_hamburguesas
iva = round(total_sin_recargo * IVA)
total_con_iva = total_sin_recargo + iva
recargo = round(total_con_iva * porcentaje_recargo(tipo_pago))
descuento = descuento_cantidad(numero_hamburguesas) + descuento_efectivo(tipo_pago)
"""
descuento_dos = descuento_efectivo(tipo_pago)
descuento_final = (descuento + descuento_dos) * recargo
"""
total_pagar = (total_con_iva + recargo) - descuento
return (f"--------------RESUMEN--------------\n"
f"Precio Unitario: ${precio}\n"
f"Cantidad: {numero_hamburguesas}\n"
f"Tipo de hamburguesa: {tipo_hamburguesa}\n"
f"Tipo de pago: {tipo_pago}\n"
f"SubTotal sin IVA: ${total_sin_recargo}\n"
f"IVA 19%: ${iva}\n"
f"Recargo: ${recargo}\n"
f"Descuentos: ${descuento}\n"
f"-----------------------------------\n"
f"TOTAL A PAGAR: ${total_pagar}\n"
f"-----------------------------------\n")
print(calcular_pedido(numero_de_hamburguesas_uno, tipo_de_hamburguesas_uno, tipo_de_pago_uno))
print(calcular_pedido(numero_de_hamburguesas_dos, tipo_de_hamburguesas_dos, tipo_de_pago_dos))
print(calcular_pedido(numero_de_hamburguesas_tres, tipo_de_hamburguesas_tres, tipo_de_pago_tres))
To embed this project on your website, copy the following code and paste it into your website's HTML: