Exemple #1
0
        /* Method to generate a random boolean array and return a IntegerSet object */
        public static IntegerSet InputSet()
        {
            int[] inputSet = new int[101];
            int   input    = 0;

            for (int i = 0; i < inputSet.Length; i++)
            {
                Console.WriteLine("Please enter a number from 0 to 100 or enter any negative number to exit: ");
                input = Convert.ToInt32(Console.ReadLine());
                if (input < 0)
                {
                    break;
                }
                if (input > -1 && input < 101)
                {
                    inputSet[i] = input;
                }
            }
            IntegerSet randomSet = new IntegerSet(inputSet);

            return(randomSet);
        }