Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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);
            }
        }