Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. package me.parzibyte.sistemaventasspringboot;
  2.  
  3. public class ProductoParaVender extends Producto {
  4. private Float cantidad;
  5.  
  6. public ProductoParaVender(String nombre, String codigo, Float precio, Float existencia, Integer id, Float cantidad) {
  7. super(nombre, codigo, precio, existencia, id);
  8. this.cantidad = cantidad;
  9. }
  10.  
  11. public ProductoParaVender(String nombre, String codigo, Float precio, Float existencia, Float cantidad) {
  12. super(nombre, codigo, precio, existencia);
  13. this.cantidad = cantidad;
  14. }
  15.  
  16. public void aumentarCantidad() {
  17. this.cantidad++;
  18. }
  19.  
  20. public Float getCantidad() {
  21. return cantidad;
  22. }
  23.  
  24. public Float getTotal() {
  25. return this.getPrecio() * this.cantidad;
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement