Created
May 21, 2020 19:27
-
-
Save parzibyte/88829b0a05b04f2771dd7c57fb46a1d2 to your computer and use it in GitHub Desktop.
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
class Producto { | |
private double precio, cantidad; | |
private String descripcion; | |
public Producto(double precio, String descripcion) { | |
this.cantidad = 1; | |
this.precio = precio; | |
this.descripcion = descripcion; | |
} | |
public double getSubtotal() { | |
return cantidad * precio; | |
} | |
public double getPrecio() { | |
return precio; | |
} | |
public double getCantidad() { | |
return cantidad; | |
} | |
public void setCantidad(double cantidad) { | |
this.cantidad = cantidad; | |
} | |
public String getDescripcion() { | |
return descripcion; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment