static void Main(string[] args) { int NumberOfRunners = ConsoleReader.GetNumber("Enter the number of maximum runners: "); Race race = new Race(NumberOfRunners); race.RegisterRunners(); race.OrganizeRace(); race.ProclaimResult(); Console.ReadKey(); }
public Runner GetRunner() { String name = ConsoleReader.GetString("Please enter the name: "); String country = ConsoleReader.GetString("Please enter the country: "); int yearOfBirth = ConsoleReader.GetNumber("Please enter the year of the birth: "); String bestRaceTime = ConsoleReader.GetString("Please enter the best race time: "); try { return(new Runner( name, country, yearOfBirth, RaceTimeConverter.ConvertStringToInt(bestRaceTime) )); } catch (Exception ex) { Console.WriteLine(ex.Message); return(null); } }