public static void Main(string[] args) { FamilyCar newCar = new FamilyCar(100, 100); newCar.Drive(25); SportCar sportCar = new SportCar(100, 100); sportCar.Drive(10); }
public static void Main(string[] args) { RaceMotorcycle motor = new RaceMotorcycle(234, 2887); motor.Drive(100); System.Console.WriteLine(motor.Fuel); FamilyCar familyCar = new FamilyCar(75, 32333); System.Console.WriteLine($"before drive : {familyCar.Fuel}"); familyCar.Drive(200); System.Console.WriteLine($"after drive {familyCar.Fuel}"); }
public void Run() { FamilyCar familyCar = new FamilyCar(100, 25.60); SportCar sportCar = new SportCar(45, 190); CrossMotorcycle crossMotorcycle = new CrossMotorcycle(200, 56.30); RaceMotorcycle raceMotorcycle = new RaceMotorcycle(250, 90.99); familyCar.Drive(5); sportCar.Drive(10); crossMotorcycle.Drive(25); raceMotorcycle.Drive(2); Console.WriteLine(familyCar); Console.WriteLine(sportCar); Console.WriteLine(crossMotorcycle); Console.WriteLine(raceMotorcycle); }
public static void Main(string[] args) { FamilyCar car = new FamilyCar(100, 40); car.Drive(5); }