public static void Main()
        {
            string repeat = "y";

            while (repeat == "y")
            {
                Console.WriteLine("*** Main Menu ***\n\nEnter a number between 1 and 9 to select a program: ");
                int input = Convert.ToInt32(Console.ReadLine());

                if (input > 0 && input < 10)
                {
                    switch (input)
                    {
                    case 1:
                        ProgramQ1.Main();
                        break;

                    case 2:
                        ProgramQ2.Main();
                        break;

                    case 3:
                        ProgramQ3.Main();
                        break;

                    case 4:
                        ProgramQ4.Main();
                        break;

                    case 5:
                        ProgramQ5.Main();
                        break;

                    case 6:
                        ProgramQ6.Main();
                        break;

                    case 7:
                        ProgramQ7.Main();
                        break;

                    case 8:
                        ProgramQ8.Main();
                        break;

                    case 9:
                        ProgramQ9.Main();
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("Number input is not within range. Please try again.");
                }
                Console.WriteLine("Type y to continue OR any key to stop program");
                repeat = Console.ReadLine();
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            int input = 0;

            do
            {
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine(" *************************************************");
                Console.WriteLine(" **                                             **");
                Console.Write(" **");
                Console.ForegroundColor = ConsoleColor.White;
                Console.Write("                  Main Menu                  ");
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine("**");
                Console.WriteLine(" **                                             **");
                Console.WriteLine(" *************************************************");
                Console.ForegroundColor = ConsoleColor.White;

                Console.WriteLine("Please select a project to run");

                Console.WriteLine("Press 1 for project 1...");
                Console.WriteLine("Press 2 for project 2...");
                Console.WriteLine("Press 3 for project 3...");
                Console.WriteLine("Press 4 to exit...");
                input = Convert.ToInt32(Console.ReadLine());
                switch (input)
                {
                case 1:
                    ProgramQ1.Main();
                    Console.Clear();
                    break;

                case 2:
                    ProgramQ2.Main();
                    Console.Clear();
                    break;

                case 3:
                    ProgramQ3.Main();
                    Console.Clear();
                    break;

                default:
                    break;
                }
            } while (input != 4);
        }
Ejemplo n.º 3
0
        public static void Main()
        {
            Console.WriteLine("Enter a number between 1 and 9 to run a program");
            string input = Console.ReadLine();

            switch (input)
            {
            case "1":
                ProgramQ1.Main();
                break;

            case "2":
                ProgramQ2.Main();
                break;

            case "3":
                ProgramQ3.Main();
                break;

            case "4":
                ProgramQ4.Main();
                break;

            case "5":
                ProgramQ5.Main();
                break;

            case "6":
                ProgramQ6.Main();
                break;

            case "7":
                ProgramQ7.Main();
                break;

            case "8":
                ProgramQ8.Main();
                break;

            case "9":
                ProgramQ9.Main();
                break;
            }
        }