Example #1
0
        public FractionArray FindNumeratorX(int numerator)
        {
            FractionArray result = new FractionArray();

            for (int i = 0; i < length; i++)
            {
                if (a[i].numerator == numerator)
                {
                    result.LastInsert(a[i]);
                }
            }
            return(result);
        }
Example #2
0
        public FractionArray FindDenominatorX(int denominator)
        {
            FractionArray result = new FractionArray();

            for (int i = 0; i < length; i++)
            {
                if (a[i].denominator == denominator)
                {
                    result.LastInsert(a[i]);
                }
            }
            return(result);
        }
Example #3
0
        public FractionArray CountPositiveFractions()
        {
            FractionArray result = new FractionArray();

            for (int i = 0; i < length; i++)
            {
                if (a[i].numerator * a[i].denominator > 0)
                {
                    result.LastInsert(a[i]);
                }
            }
            return(result);
        }