Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
Begin:

            Console.Write("Race Name? ");
            string race_name = Console.ReadLine();

            Console.Write("Length for " + race_name + "? ");
            int race_length = Convert.ToInt16(Console.ReadLine());

            //TODO: Add code here
            //your code here
            //create object of Race
            Race objRace = new Race(race_name, race_length);

            //TODO: Add code here
            //your code here
            //input cars

            Console.Write("How many cars? ");
            int carCount = Convert.ToInt16(Console.ReadLine());

            for (int i = 0; i < carCount; i++)
            {
                Console.Write("Car Name? ");
                string carName = Console.ReadLine();

                Console.Write("Speed for Car " + carName + "? ");
                int carSpeed = Convert.ToInt16(Console.ReadLine());

                objRace.ListCar.Add(new Car(carSpeed, carName));
            }

            Console.WriteLine();

            //TODO: Add code here
            //your code here
            //Show race result
            objRace.proRace();

            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
            Console.Clear();
            goto Begin;
        }