package me.parzibyte.sistemaventasspringboot; | |
public class ProductoParaVender extends Producto { | |
private Float cantidad; | |
public ProductoParaVender(String nombre, String codigo, Float precio, Float existencia, Integer id, Float cantidad) { | |
super(nombre, codigo, precio, existencia, id); | |
this.cantidad = cantidad; | |
} | |
public ProductoParaVender(String nombre, String codigo, Float precio, Float existencia, Float cantidad) { | |
super(nombre, codigo, precio, existencia); | |
this.cantidad = cantidad; | |
} | |
public void aumentarCantidad() { | |
this.cantidad++; | |
} | |
public Float getCantidad() { | |
return cantidad; | |
} | |
public Float getTotal() { | |
return this.getPrecio() * this.cantidad; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment