JunkJumper 91677806cf Revert "renommage package tree"
This reverts commit ab956d17fc461e31d20fdb32e6029d403d75dc06.
2020-05-20 17:10:40 +02:00

33 lines
650 B
Java

package vehicule;
public class Vehicule {
protected String marque;
protected int dateAchat;
protected double prixAchat;
protected double prixCourant;
public Vehicule() {
marque = "";
dateAchat = 0;
prixAchat = 0;
prixCourant = 0;
}
public Vehicule(String s, int d, double pA) {
this.marque = s;
dateAchat = d;
prixAchat = pA;
prixCourant = 0;
}
public void calculPrix(int y) {
int previousY = this.dateAchat - y;
this.prixCourant = this.prixAchat - ((this.prixAchat/100) * previousY);
}
public void affiche() {
System.out.println(""+this.marque+" "+this.dateAchat+" "+this.prixAchat+" "+prixCourant);
}
}