Esempio n. 1
0
        static string RaceCars(Car a, Car b)

        {
            Console.WriteLine($"Line 1:{a.Driver.Name} driving {a.Model}");
            Console.WriteLine($"Line 2:{b.Driver.Name} driving {b.Model}");
            if (a.CalculateSpeed() < b.CalculateSpeed())
            {
                return($"{b.Model} with driver {b.Driver.Name} is the faster car");
            }
            else if (a.CalculateSpeed() > b.CalculateSpeed())
            {
                return($"{a.Model} with driver {a.Driver.Name} is the faster car");
            }
            else
            {
                return($"The cars are equally fast");
            }
        }