static void Main(string[] args) { Audi a = new Audi(); a.Refuel(5); a.SetRegistrationNumber("7856 IM-1"); a.PrintInfo(); Console.WriteLine(); Transport b = new Mercedes(Mercedes.MercedesModel.SLS, ConsoleColor.Green); b.PrintInfo(); }
static void Main(string[] args) { Audi a = new Audi(); a.SetRegistrationNumber("5726 XW-5"); a.AudiNotify += DisplayMessage; a.SetRegistrationNumber("4235 KM-4"); a.Use(); a.Refuel(); a.Notify += DisplayMessage; a.Use(); a.Beep(); Car.MakePolice(a); a.Beep(); }
static void Main(string[] args) { Audi a = new Audi(); Mercedes b = new Mercedes(Mercedes.MercedesModel.SLS, ConsoleColor.Cyan); Volkswagen c = new Volkswagen(ConsoleColor.DarkGray); b.Facing(); b.Facing(); c.Facing(); a.Facing(); Car d = new Car(1834, "Belarus"); Car e = new Car("Iran"); Car[] cars = new Car[] { a, b, c, d, e }; Array.Sort(cars); foreach (Car car in cars) { Console.WriteLine(car.GetCountry()); } }