inserisciDatiScontrino
This commit is contained in:
@@ -23,20 +23,43 @@ public class Prodotto {
|
||||
this.scontoFidelityCard = p_scontoFidelityCard;
|
||||
this.descrizione = p_descrizione;
|
||||
}
|
||||
|
||||
public void stampaDati(){
|
||||
|
||||
public void stampaDati() {
|
||||
|
||||
}
|
||||
|
||||
public float checkQtaDisponibile(String nome, float qtaDaComprare){
|
||||
public float checkQtaDisponibile(String nome, float qtaDaComprare) {
|
||||
float ritorno;
|
||||
if (!this.nome.equals(nome)) {
|
||||
ritorno = 0; // oppure potresti lanciare un'eccezione
|
||||
}
|
||||
|
||||
if (this.qta >= qtaDaComprare) {
|
||||
ritorno = qtaDaComprare;
|
||||
} else {
|
||||
ritorno = this.qta;
|
||||
}
|
||||
|
||||
return ritorno;
|
||||
}
|
||||
|
||||
public void updQtaMagazzino(String nome, float qtaFinale){
|
||||
public void updQtaMagazzino(String nome, float qtaFinale) {
|
||||
|
||||
}
|
||||
|
||||
public void applicaSconto() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
public float getQta() {
|
||||
return this.qta;
|
||||
}
|
||||
|
||||
public void decreaseQuantity(float p_qta) {
|
||||
this.qta -= p_qta;
|
||||
}
|
||||
|
||||
public String getNome() {
|
||||
return this.nome;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user