public int year { get; set; }
public string color { get; set; }
public string maker { get; set; }
public string model { get; set; }
public int topSpeed { get; set; }
public Car(int year, string color, string maker, string model, int topSpeed)
this.topSpeed = topSpeed;
static void Main(string[] args)
Car car1 = new Car(1998, "Matte Black", "Nissan", "Skyline r34 GTR", 305);
Car car2 = new Car(2012, "Matte White", "Nissan", "Nismo 370z", 288);
string t1 = Faster(car1, car2)[0];
string t2 = Faster(car1, car2)[1];
Console.WriteLine("The faster car is the {0}, reaching a speed of {1} km/h",t1,t2);
public static string[] Faster(Car car1, Car car2)
string[] returnedArray = new string[2];
if (car1.topSpeed > car2.topSpeed)
returnedArray[0] = car1.model;
returnedArray[1] = car1.topSpeed.ToString();
else if (car2.topSpeed > car1.topSpeed)
returnedArray[0] = car2.model;
returnedArray[1] = car2.topSpeed.ToString();