Exemplo n.º 1
0
        public static void InitializeFactorObject(factor[] objArr,
                                                  int[] factorArr, Random rand)
        {
            Console.WriteLine("\n");
            Console.WriteLine("Initialize " + ARR_SIZE + " factor objects class.");
            int factorValue;

            for (int i = 0; i < ARR_SIZE; i++)
            {
                factorValue  = rand.Next(MIN_FACTOR, MAX_FACTOR);
                factorArr[i] = factorValue;
                objArr[i]    = new factor((uint)factorValue);
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Random rand = new Random();

            ProgramIntro();
            factor[] objArray    = new factor[ARR_SIZE];
            int[]    factorArray = new int[ARR_SIZE];
            InitializeFactorObject(objArray, factorArray, rand);
            TestObjectWithRandomNumber(objArray, factorArray, rand);
            TestQueryCount(objArray, factorArray);
            ResetObjects(objArray);
            TestInactiveObject(objArray, factorArray, rand);
            TestQueryCount(objArray, factorArray);
            ResetObjects(objArray);
            Console.Write("\n");
            Console.Write("Press any key to terminate program... ");
            Console.ReadKey();
        }