Opzione 2

This commit is contained in:
La Programmatrice Verde
2026-01-13 20:52:55 +01:00
parent 813152e531
commit 6476d94a3b
2 changed files with 10 additions and 2 deletions

View File

@@ -43,6 +43,10 @@ public class ContoCorrente {
return numeroContoCorrente;
}
public void versa(double quantita){
this.saldo += quantita;
}
public void preleva(double quantita) throws IllegalArgumentException{
if (quantita >= this.saldo) {
throw new IllegalArgumentException("La quantità desiderata eccede il saldo corrente.");