complete workshop assignments

This commit is contained in:
amirM.t
2026-04-28 09:12:10 +03:30
parent e8aedb8354
commit 1a78323743
7 changed files with 222 additions and 155 deletions
+12 -6
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;
/*
@@ -10,13 +13,16 @@ import org.model.Vehicle;
public class VehicleInspector {
public static void inspect(Vehicle v) {
public static void inspect(Vehicle v)
{
v.basicInfo();
// TODO:
// If ElectricCar → print "Check battery system"
// If SportsCar → print "Check brakes and performance"
// If GasCar → print "Check engine and oil"
switch (v)
{
case ElectricCar electricCar -> System.out.println("Check battery system");
case SportsCar sportsCar -> System.out.println("Check brakes and performance");
case GasCar gasCar -> System.out.println("Check engine and oil");
default -> {}
}
}
}