Beispiel #1
0
        static void ArmstrongLoop(int loopSize)
        {
            MathStuff ms = new MathStuff();

            for (int n = 0; n <= loopSize; n++)
            {
                if (ms.ArmstrongNumberCheck(n))
                {
                    Console.WriteLine("{0} is an Armstrong Number!", n.ToString());
                }
            }
        }
Beispiel #2
0
        static void AddNumbers()
        {
            MathStuff ms = new MathStuff();

            Console.WriteLine("Plus Method: " + ms.PlusMethod(8, 9));
            Console.WriteLine("Plus Method: " + ms.PlusMethod(8.01, 9.01));
            Console.WriteLine("Plus Method: " + ms.PlusMethod(8, 9, 10));
            Console.WriteLine("Plus Method: " + ms.PlusMethod(8.5, 9.7, 10.15));


            Console.WriteLine("Mult Method: " + ms.MultMethod(8, 9));
            Console.WriteLine("Mult Method: " + ms.MultMethod(8.01, 9.01));
        }
Beispiel #3
0
        static void Armstrong()
        {
            Console.Write("Enter number: ");
            int n = int.Parse(Console.ReadLine());

            MathStuff ms = new MathStuff();


            if (ms.ArmstrongNumberCheck(n))
            {
                Console.WriteLine("Armstrong Number!");
            }
            else
            {
                Console.WriteLine("Not Armstrong Number!");
            }
        }