Advertisement
Guest User

Recorridos

a guest
Jun 17th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.96 KB | None | 0 0
  1. import numpy as np
  2. import os
  3. bus = np.zeros([12,4], dtype = object)
  4. pasajero = np.zeros([12,4], dtype = object)
  5. rut = np.zeros([12,4], dtype = object)
  6. telefono = np.zeros([12,4], dtype = object)
  7. costo = np.zeros([12,4], dtype = object)
  8.  
  9. #lista pasajeros
  10. pasajero1=[]
  11. rut1=[]
  12. telefono1=[]
  13. costo1=[]
  14.  
  15. def reservar():
  16.     fila = int(input ("Fila>>"))
  17.     colu = int(input ("Colu>>"))
  18.     if (bus[fila][colu]==1):
  19.         print ("Ocupado")
  20.     else:
  21.         name = input("nombre:>>")
  22.         pasajero[fila][colu]=name
  23.         pasajero1.append(name)
  24.         rt = input("rut:>>")
  25.         rut [fila][colu]=rt
  26.         rut1.append(rt)
  27.         tele = int(input("telefono:>>"))
  28.         telefono [fila][colu]=tele
  29.         telefono1.append(tele)
  30.         bus[fila][colu]=1        
  31.         print ("Reserva exitosa")
  32.         if (fila>8):
  33.             costo [fila][colu]= 6800
  34.         else:
  35.             costo [fila][colu]= 5000
  36.             costo1.append(costo)
  37.  
  38.  
  39.  
  40.                
  41. def datos_pasajeros ():
  42.     fila = int(input ("Fila>>"))
  43.     colu = int(input ("Colu>>"))
  44.     for i in range(fila):
  45.         for j in range(colu):
  46.             if (bus[fila][colu]==1):
  47.                 print (f"Pasaje a nombre de:\t{pasajero1[i][j]}")
  48.                 print (f"Rut:\t\t\t{rut1[i][j]}")
  49.                 print (f"Telefono:\t\t{telefono1[i][j]}")
  50.                 print (f"valor de pasaje:\t{costo1[i][j]}")
  51.                 print("")
  52.             else:
  53.                 print("Asiento disponible, sin datos para mostrar")
  54.  
  55.  
  56. def modificar():
  57.     print ("Indique fila y columna a modificar")
  58.     fila = int(input ("Fila>>"))
  59.     colu = int(input ("Colu>>"))
  60.     if (bus[fila][colu]==1):
  61.         bus[fila][colu]=0
  62.         print("indique la nueva fila y columna a reservar")
  63.         reservar()
  64.  
  65. def listar():
  66.     for i in range(12):
  67.         for j in range (4):
  68.             if (bus[i][j]!=0):
  69.                 print (pasajero[i][j])
  70.  
  71.            
  72. while (1):
  73.     print ("\t Reserva de pasajes")
  74.     print ("1)Asientos disponibles")
  75.     print ("2)Reservar asientos")
  76.     print ("3)modificar asientos")
  77.     print ("4)Datos de los pasajeros")
  78.     print ("5)Lista de pasajeros")
  79.     print ("6)Salir")
  80.     opcion = input (">>")
  81.     if (opcion == "1"):
  82.         print (bus)
  83.         print("presione Enter para continuar")
  84.         input()
  85.         os.system("cls")
  86.     if (opcion == "2"):
  87.         reservar()
  88.         print("presione Enter tecla para continuar")
  89.         input()
  90.         os.system("cls")
  91.     if (opcion == "3"):
  92.         modificar()
  93.         print("presione Enter tecla para continuar")
  94.         input()
  95.         os.system("cls")
  96.     if (opcion == "4"):
  97.         datos_pasajeros()
  98.         print("presione Enter tecla para continuar")
  99.         input()
  100.         os.system("cls")
  101.        
  102.     if (opcion == "5"):
  103.         listar()
  104.         print("presione Enter tecla para continuar")
  105.         input()
  106.         os.system("cls")  
  107.     if (opcion == "6"):
  108.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement