Initial Commit

This commit is contained in:
La Programmatrice Verde
2025-11-13 13:03:57 +01:00
commit 0c5831809b
13 changed files with 2721 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package b_bassanetti;
/**
*
* @author alunno
*/
public class Trecce {
int codice;
String nome;
String forma;
String colore;
double costo;
public Trecce(int codice, String nome, String forma, String colore, double costo) {
this.codice = codice;
this.nome = nome;
this.forma = forma;
this.colore = colore;
this.costo = costo;
}
@Override
public String toString(){
return "Codice: " + this.codice
+ "\nNome: " + this.nome
+ "\nForma: " + this.forma
+ "\nColore: " + this.colore
+ "\nCosto: " + this.costo ;
}
public void aggiornaCosto(boolean direzione, double percentuale){ //true = aumenta
//false = decrementa
if(direzione){
this.costo += (this.costo * percentuale) / 100;
}else{
this.costo -= (this.costo * percentuale) / 100;}
}
public String getColore() {
return colore;
}
public double getCosto() {
return costo;
}
}