I can see it in my version it looks like this:
Code:
// Compare two cars.
public int Compare(Car car1, Car car2)
{
// Compare differently depending on the sort type.
switch (Sort)
{
case SortType.ByName:
return car1.Name.CompareTo(car2.Name);
case SortType.ByMaxSpeed:
return -car1.MaximumSpeed.CompareTo(car2.MaximumSpeed);
case SortType.ByHorsepower:
return -car1.Horsepower.CompareTo(car2.Horsepower);
case SortType.ByPrice:
return -car1.Price.CompareTo(car2.Price);
}
// This should never happen (unless we add a
// new SortStyle value and forget to update the cases.)
throw new Exception("Unknown SortType value");
}
Does your version of the program run? It shouldn't work if that method isn't there. Perhaps there was something wrong with the download?
If you can't get your version to work, email me at
[email protected] and I'll send you a new version.