# SISTEMA DE PAGOS DEL RESTAURANTE BURGER LA 5

#precio de las hamburguesas 
PRECIO_SENCILLA = 20000
PRECIO_DOBLE = 25000
PRECIO_TRIPLE = 28000



IVA = 0.19
RECARGO_CREDITO = 0.07
DESCUENTO_EFECTIVO = 0.05
DESCUENTO_CANTIDAD = 0.03

def pedir_cantidad(mensaje):
    while True:
        try:
            cantidad = int(input(mensaje))

            if cantidad > 0:
                return cantidad
            else:
                print("Error: la cantidad debe ser mayor que cero.")

        except ValueError:
            print("Error: debes escribir un numero entero valido.")


def calcular_pago(tipo, cantidad, tipo_pago):

    if tipo == "1":
        nombre_hamburguesa = "Sencilla"
        precio_unitario = PRECIO_SENCILLA
    elif tipo == "2":
        nombre_hamburguesa = "Doble"
        precio_unitario = PRECIO_DOBLE
    else:
        nombre_hamburguesa = "Triple"
        precio_unitario = PRECIO_TRIPLE

    if tipo_pago == "1":
        nombre_pago = "Tarjeta Credito"
    elif tipo_pago == "2":
        nombre_pago = "Tarjeta Debito"
    else:
        nombre_pago = "Efectivo"

   
    subtotal = precio_unitario * cantidad
    valor_iva = round(subtotal * IVA)
    total_con_iva = subtotal + valor_iva

    recargo = 0
    porcentaje_descuento = 0

    if tipo_pago == "1":
        recargo = round(total_con_iva * RECARGO_CREDITO)
    elif tipo_pago == "3":
        porcentaje_descuento = DESCUENTO_EFECTIVO

    if cantidad > 10:
        porcentaje_descuento = (
            porcentaje_descuento + DESCUENTO_CANTIDAD
        )

    descuentos = int(total_con_iva * porcentaje_descuento)

    total_pagar = total_con_iva + recargo - descuentos

    print("\n------------- RESUMEN -------------")
    print(f"Precio Unitario: $ {precio_unitario}")
    print(f"Cantidad: {cantidad}")
    print(f"Tipo de hamburguesa: {nombre_hamburguesa}")
    print(f"Tipo de pago: {nombre_pago}")
    print(f"Subtotal sin IVA: $ {subtotal}")
    print(f"IVA 19%: $ {valor_iva}")
    print(f"Recargo: $ {recargo}")
    print(f"Descuentos: $ {descuentos}")
    print("-----------------------------------")
    print(f"TOTAL A PAGAR: $ {total_pagar}")
    print("-----------------------------------")

    return total_pagar

print("RESTAURANTE BURGER LA 5")
print("SISTEMA DE LIQUIDACION DE PEDIDOS")

cantidad = pedir_cantidad("\nNumero de hamburguesas: ")

print("\n--- TIPOS DE HAMBURGUESA ---")
print(f"1. Sencilla: $ {PRECIO_SENCILLA}")
print(f"2. Doble: $ {PRECIO_DOBLE}")
print(f"3. Triple: $ {PRECIO_TRIPLE}")

tipo = input("Selecciona el tipo (1, 2 o 3): ").strip()

while tipo != "1" and tipo != "2" and tipo != "3":
    print("Error: debes seleccionar 1, 2 o 3.")
    tipo = input("Selecciona el tipo (1, 2 o 3): ").strip()

print("\n--- TIPOS DE PAGO ---")
print("1. Tarjeta de credito")
print("2. Tarjeta debito")
print("3. Efectivo")

tipo_pago = input("Selecciona el tipo de pago (1, 2 o 3): ").strip()

while tipo_pago != "1" and tipo_pago != "2" and tipo_pago != "3":
    print("Error: debes seleccionar 1, 2 o 3.")
    tipo_pago = input(
        "Selecciona el tipo de pago (1, 2 o 3): "
    ).strip()
calcular_pago(tipo, cantidad, tipo_pago)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: