develop #1

Open
HadiSharifi wants to merge 8 commits from develop into master
2 changed files with 16 additions and 12 deletions
Showing only changes of commit 13e41f5f21 - Show all commits
+1 -1
View File
@@ -46,7 +46,7 @@ public class ElectricCar extends Car implements Chargeable {
}
setChargeLevel(getChargeLevel() + amount);
}
@Override
public boolean needsService(Vehicle v) {
return getMileage() > 8000;
+15 -11
View File
@@ -1,13 +1,5 @@
package org.model;
/*
* SportsCar extends GasCar.
*
* Special service logic for SportsCar:
* - needsService(): return true if mileage > 5000
* - performService():
* Print "High-performance brake system checked"
*/
public class SportsCar extends GasCar {
@@ -23,8 +15,20 @@ public class SportsCar extends GasCar {
this.zeroToHundred = zeroToHundred;
}
@Override
public void showDetails() {
super.showDetails();
System.out.println("acceleration time: " + this.zeroToHundred);
}
// TODO: Override showDetails()
// Call super.showDetails()
// Print acceleration time
@Override
public boolean needsService(Vehicle v) {
return getMileage() > 5000;
}
@Override
public void performService() {
System.out.println("High-performance brake system checked");
}
}