Advertisement
adaptingear

taller

Sep 20th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.81 KB | None | 0 0
  1. import random
  2.  
  3. class vehiculo():
  4.   matricula = ["KHV-608", "JFI-433", "FFG-432", "FDG-553", "SDJ-434", "KIS-432", "SDF-433"]
  5.   chevrolet = [50000, 100000, 150000]
  6.   alquilado = False
  7.   devolver = False
  8.   bool = "True"
  9.  
  10. #Constructor
  11.   def skere(self, camiones, turismo):
  12.     self.camiones = camiones
  13.     self.turismo = turismo
  14.  
  15. #Metodos
  16.   def alquilar(self):
  17.       self.alquilado = True
  18.       return alquilado
  19.  
  20.   def devolver(self):
  21.     self.devolver = True
  22.     return devolver
  23.  
  24.  
  25. def imprimirmatricula():
  26.   aleatorio1 = random.choice(vehiculo.matricula)
  27.   print(aleatorio1)
  28.  
  29. def carrosturismo():
  30.     aleatorio2 = random.choice(vehiculo.chevrolet)
  31.     print(aleatorio2)
  32.  
  33. def turismos(self):
  34.   self.PrecioKm = PrecioKm
  35.   self.kmAlquiler = kmAlquiler
  36.  
  37. def camiones(self):
  38.   self.precioDia = precioDia
  39.   self.diaAlquiler = diaAlquiler
  40.  
  41.  
  42. while(True):
  43.   print("-----MENU-----\n"+
  44.         "Que vehiculo desea?\n"+
  45.         "1. Turismo \n"+
  46.         "2. Camiones\n")
  47.   num = input("Ingrese la Opcion\n")
  48.   if num == "1":
  49.       print("El precio del km es de: 100 \n")
  50.       x = int(input("Cuantos km va a recorrer?\n"))
  51.       turismos.PrecioKm = 100
  52.       turismos.kmAlquiler = x
  53.       x = x*turismos.PrecioKm
  54.       print("Su vehiculo es:")
  55.       imprimirmatricula()
  56.       print("Su kilometraje del vehiculo es:")
  57.       c = carrosturismo()
  58.  
  59.       print("Su viaje va a tener un precio de: ")
  60.       print(x)
  61.       break
  62.   elif num == "2":
  63.       print("El precio del dia es de: 200 \n")
  64.       z = int(input("Cuantos dias  va a alquilarlo?\n"))
  65.       camiones.precioDia = 200
  66.       camiones.diaAlquiler = z
  67.       z = z*camiones.precioDia
  68.       print("Su vehiculo es:")
  69.       imprimirmatricula()
  70.       print("Su viaje va a tener un precio de: ")
  71.       print(z)
  72.       break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement