Advertisement
Guest User

Producto.py

a guest
Jun 25th, 2012
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.19 KB | None | 0 0
  1. class Producto:
  2.     def __init__(self, numero_producto, nombre_producto, cantidad_existente, precio_por_unidad):
  3.         self.numero_producto = numero_producto
  4.         self.nombre_producto = nombre_producto
  5.         self.cantidad_existente = cantidad_existente
  6.         self.precio_por_unidad = precio_por_unidad
  7.        
  8.     def getNombre(self):
  9.         return self.nombre_producto
  10.    
  11.     def setNombre(self, nombre_producto):
  12.         self.nombre_producto = nombre_producto
  13.        
  14.     def getNumero(self):
  15.         return self.numero_producto
  16.  
  17.     def setNumero(self, numero_producto):
  18.         self.numero_producto = numero_producto
  19.  
  20.     def getCantidad(self):
  21.         return self.cantidad_existente
  22.    
  23.     def setCantidad(self, cantidad_existente):
  24.         self.cantidad_existente = cantidad_existente
  25.  
  26.     def getPrecio(self):
  27.         return self.precio_por_unidad
  28.    
  29.     def setPrecio(self, precio_por_unidad):
  30.         self.precio_por_unidad = precio_por_unidad
  31.  
  32.     def getInformacion(self):        
  33.         informacion = "%i\t\t%s\t\t%i\t\t%f" % (self.numero_producto, self.nombre_producto, self.cantidad_existente, self.precio_por_unidad)
  34.         return informacion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement