Пример #1
0
        private static GeometricProgression GenerateGeometricProgression(out GeometricProgression[] geomProgressionArray)
        {
            var geomProgression = new GeometricProgression(GenerateDouble(Random.Next(1, 3), Random.Next(3, 6)),
                                                           GenerateDouble(Random.Next(1, 3), Random.Next(3, 6)));

            geomProgressionArray = new GeometricProgression[Random.Next(5, 16)];

            for (var i = 0; i < geomProgressionArray.Length; i++)
            {
                geomProgressionArray[i] = new GeometricProgression(GenerateDouble(0, 10), GenerateDouble(0, 5));
            }

            return(geomProgression);
        }
Пример #2
0
        private static void LargerThan(int step, GeometricProgression geomProgression,
                                       GeometricProgression[] geomProgressionArray)
        {
            var flag = true;

            WriteLine($"Geometric progression element {step} larger than {geomProgression[step]}.\n");
            foreach (var geomProgress in geomProgressionArray)
            {
                if (Math.Abs(geomProgress[step] - geomProgression[step]) < Eps)
                {
                    WriteLine(geomProgress);
                    flag = false;
                }
            }

            if (flag)
            {
                WriteLine($"There are no progression with element {step} larger than {geomProgression[step]}");
            }
        }