This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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