Beispiel #1
0
        internal static void Run()
        {
            const double pi    = 3.14159;
            double       input = 0;

            try
            {
                Console.Write("Radius: ");
                input = double.Parse(Console.ReadLine());
                Console.WriteLine("Circumference of a Circle\n\n" +
                                  "Circumference: {0}", (2 * pi) * input);
            }
            catch
            {
                Console.WriteLine("Invalid Input.");
                Exercise_10.Run();
            }
        }
Beispiel #2
0
        internal static void exercise(int num)
        {
            switch (num)
            {
            case 3:
                Exercise_3.Run();
                break;

            case 4:
                Exercise_4.Run();
                break;

            case 5:
                Exercise_5.Run();
                break;

            case 10:
                Exercise_10.Run();
                break;
            }
            Console.WriteLine("\nType 'menu' to return to the menu, 'exit' to close the application.");
            Options();
        }