Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created May 21, 2020 19:27
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/88829b0a05b04f2771dd7c57fb46a1d2 to your computer and use it in GitHub Desktop.
Save parzibyte/88829b0a05b04f2771dd7c57fb46a1d2 to your computer and use it in GitHub Desktop.
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