Example #1
0
def main():
    screen.clear()
    printScreen()

    edad = pedirEdad()
    precioTotal = 0

    while edad != 0:
        tipoE = tipoEntrada(edad)
        precioE = preciosE[tipoE]
        numEntradas[tipoE] += 1

        screen.Print(numEntradas[tipoE], entradaQ[tipoE]['cantidad'][0],
                     entradaQ[tipoE]['cantidad'][1])
        screen.Print("{:7.2f}€".format(precioE * numEntradas[tipoE]),
                     entradaQ[tipoE]['precioA'][0],
                     entradaQ[tipoE]['precioA'][1])
        precioTotal += precioE
        screen.Format(1)
        screen.Print("{:7.2f}€".format(precioTotal), 9, 19)
        screen.Format(0)

        edad = pedirEdad()

    screen.locate(12, 1)
Example #2
0
def printScreen():
    screen.Print("Bebe....:    -", 4, 4)
    screen.Print("Niño....:    -", 5, 4)
    screen.Print("Adulto..:    -", 6, 4)
    screen.Print("Jubilado:    -", 7, 4)
    screen.Format(1)
    screen.Print("Total....:", 9, 8)
    screen.Format(0)
Example #3
0
File: zoo.py Project: lvillen/Zoo
def main():
    front.printScreen()

    edad = front.pedirEdad()
    precioTotal = 0  #Negocio

    while edad != 0:
        tipoE = tipoEntrada(edad)
        precioE = preciosE[tipoE]

        numEntradas[tipoE] += 1

        screen.Print(numEntradas[tipoE], entradasQ[tipoE]['cantidad'][0],
                     entradasQ[tipoE]['cantidad'][1])
        screen.Print("{:7.2f}€".format(numEntradas[tipoE] * precioE),
                     entradasQ[tipoE]['precioA'][0],
                     entradasQ[tipoE]['precioA'][1])

        precioTotal += precioE
        screen.Format(1)
        screen.Print("{:7.2f} €".format(precioTotal), 9, 19)
        screen.Reset()

        edad = front.pedirEdad()

    screen.locate(11, 1)
def printScreen():
    screen.clear()
    screen.Print("Bebe....:   -", 4, 5)
    screen.Print("Niño....:   -", 5, 5)
    screen.Print("Adulto..:   -", 6, 5)
    screen.Print("Jubilado:   -", 7, 5)

    screen.Format(1)
    screen.Print("Total....:", 9, 8)
    screen.Reset()
Example #5
0
def printScreen():
    screen.clear()
    screen.Print("Bebe....:   -", line=4, column=5)
    screen.Print("Niño....:   -", line=5, column=5)
    screen.Print("Adulto..:   -", line=6, column=5)
    screen.Print("Jubilado:   -", line=7, column=5)

    screen.Format(1)
    screen.Print("Total....:", line=9, column=8)
    screen.Reset()
def pedirEdad():
    edad = screen.Input("¿Qué edad tienes? ", 1, 1)
    while validaEdad(edad) == False:
        screen.Format(0, 33, 41)
        screen.Print("Edad inválida", 25, 1, True)
        screen.Reset()
        edad = screen.Input("¿Qué edad tienes? ", 1, 1)

    screen.clearLine(25)

    return int(edad)
Example #7
0
def pedirEdad():

    edad = screen.Input("Que edad tienes? ", 1, 1)

    while validaEdad(edad) == False:

        screen.Format(0, 30, 43)
        screen.Print("Error. edad invalida.", 25, 1, True)
        screen.Reset()
        edad = screen.Input("Reintroduce la edad: ", 1, 1)
    screen.clearLine(25)
    return int(edad)