Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 4, 2019 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/c1ea75a5b0d90bca7460235d6eaf5f1c to your computer and use it in GitHub Desktop.
Save parzibyte/c1ea75a5b0d90bca7460235d6eaf5f1c to your computer and use it in GitHub Desktop.
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