tp2correction

This commit is contained in:
2025-10-07 16:41:03 +02:00
commit bc2d9723d2
11 changed files with 597 additions and 0 deletions

31
GestionTravaux.java Normal file
View File

@@ -0,0 +1,31 @@
package lepack;
import java.util.ArrayList;
public class GestionTravaux {
private ArrayList<Batiment> listeBatiments;
private ArrayList<Ouverture> listeOuvertures;
private ArrayList<Technicien> listeTechniciens;
public GestionTravaux() {
this.listeBatiments = new ArrayList<>();
this.listeOuvertures = new ArrayList<>();
this.listeTechniciens = new ArrayList<>();
}
public ArrayList<Ouverture> getOuverturesNecessitantPlusDeKTechniciens(int k) {
ArrayList<Ouverture> resultat = new ArrayList<>();
for (Ouverture o : this.listeOuvertures) {
if (o.getNombreInstallateurs() > k) {
resultat.add(o);
}
}
return resultat;
}
}