Commit fa45fb1e authored by Théo GORDYJAN's avatar Théo GORDYJAN

Modify engine type and add interface Option

parent 60366711
This diff is collapsed.
package Engine;
public class DieselEngine {
public class DieselEngine extends Engine {
public DieselEngine(String _cylindre, Double _price) {
super(_cylindre, _price);
this.type = EngineType.DIESEL;
}
public String toString() {
return "Diesel Engine";
}
}
......@@ -2,18 +2,23 @@ package Engine;
public class Engine {
private EngineType type;
protected EngineType type;
private String cylindre;
private Double price;
public Engine (EngineType _type, String _cylindyre, Double price) {
public Engine (String _cylindre, Double _price) {
this.cylindre = _cylindre;
this.price = _price;
}
public String toString() {
return "This vehicle has a " + cylindre + "engine, it's a " + type + " engine and it costs " + price + " €.";
}
public String getCylindre() {
return this.cylindre;
}
public Double getPrice() {
......
package Option;
public class Option {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment