Exercice 3 Part 1
This commit is contained in:
parent
32ec759aa6
commit
04fa7e604a
2 changed files with 29 additions and 0 deletions
22
src/exercice3part1.java
Normal file
22
src/exercice3part1.java
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import partie3.Voiture;
|
||||||
|
|
||||||
|
public class exercice3part1 {
|
||||||
|
public static void main(String[] argv)
|
||||||
|
{
|
||||||
|
Voiture volkswagen = new Voiture();
|
||||||
|
volkswagen.puissance = 30;
|
||||||
|
volkswagen.vitesse = 0;
|
||||||
|
volkswagen.estDemarre = false;
|
||||||
|
Voiture renault = new Voiture();
|
||||||
|
renault.puissance = 500;
|
||||||
|
renault.vitesse = 200;
|
||||||
|
renault.estDemarre = true;
|
||||||
|
|
||||||
|
System.out.println(renault.puissance);
|
||||||
|
System.out.println(renault.vitesse);
|
||||||
|
System.out.println(renault.estDemarre);
|
||||||
|
System.out.println(volkswagen.puissance);
|
||||||
|
System.out.println(volkswagen.vitesse);
|
||||||
|
System.out.println(volkswagen.estDemarre);
|
||||||
|
}
|
||||||
|
}
|
7
src/partie3/Voiture.java
Normal file
7
src/partie3/Voiture.java
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
package partie3;
|
||||||
|
|
||||||
|
public class Voiture {
|
||||||
|
public int puissance;
|
||||||
|
public int vitesse;
|
||||||
|
public boolean estDemarre;
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue