Beispiel #1
0
        public void Run()
        {
            int var = GetNumberFromUser();

            Console.WriteLine($"The factors of {var} are: ");
            int countOfFactors = FactorFinder.GetFactorsCount(var);

            int[] foundFactors = FactorFinder.GetFactors(countOfFactors, var);

            Console.WriteLine($"{string.Join(", ", foundFactors)}");



            if (PrimeChecker.IsPrimeNumber(var) == true)
            {
                Console.WriteLine($"{var} is PRIME");
            }

            else
            {
                Console.WriteLine($"{var} is NOT PRIME ");
            }

            if (PerfectChecker.GetPerfectNumber(var) == true)
            {
                Console.WriteLine($"{var} is a PERFECT number!");
            }
            else
            {
                Console.WriteLine($"{var} is NOT a PERFECT number!");
            }
        }