Refonte du repo
This commit is contained in:
29
src/TD4/vehicule/GestionVehicule.java
Normal file
29
src/TD4/vehicule/GestionVehicule.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package vehicule;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
public class GestionVehicule {
|
||||
private static int ANNEE_ACTUELLE = Calendar.getInstance().get(Calendar.YEAR);
|
||||
|
||||
public static void main(String[] args) {
|
||||
Voiture[] garage = new Voiture[3];
|
||||
Avion[] hangar = new Avion[2];
|
||||
|
||||
garage[0] = new Voiture("Peugeot", 2005, 13400.00, 1.4, 5, 4.0, 12000);
|
||||
garage[1] = new Voiture("Porsche", 2010, 160000.00, 3.6, 2, 25.0, 8320);
|
||||
garage[2] = new Voiture("Fiat", 1999, 8400.00, 1.2, 3, 5.0, 125000);
|
||||
|
||||
hangar[0] = new Avion("Cessna", 1979, 204739.90, "HELICES", 250);
|
||||
hangar[1] = new Avion("Gulfstream", 1993, 4321098.00, "REACTION", 1300);
|
||||
|
||||
for (int i = 0; i < garage.length; i++) {
|
||||
garage[i].calculePrix(ANNEE_ACTUELLE);
|
||||
garage[i].affiche();
|
||||
}
|
||||
|
||||
for (int i = 0; i < hangar.length; i++) {
|
||||
hangar[i].calculePrix(ANNEE_ACTUELLE);
|
||||
hangar[i].affiche();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user