implement project #1

Open
Fateme_Azizi wants to merge 10 commits from develop into master
Showing only changes of commit faffb3c801 - Show all commits
+12 -4
View File
@@ -1,6 +1,9 @@
package org.util;
import org.*;
import org.model.ElectricCar;
import org.model.GasCar;
import org.model.SportsCar;
import org.model.Vehicle;
/*
@@ -13,10 +16,15 @@ public class VehicleInspector {
public static void inspect(Vehicle v) {
v.basicInfo();
String type = v.getEnergyType();
// TODO:
// If ElectricCar → print "Check battery system"
// If SportsCar → print "Check brakes and performance"
// If GasCar → print "Check engine and oil"
if(v instanceof ElectricCar)
System.out.println("Check battery system");
else if(v instanceof SportsCar)
System.out.println("Check brakes and performance");
else if(v instanceof GasCar)
System.out.println("Check engine and oil");
}
}