コード例 #1
0
        public static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Yellow;

            ConsoleHelper.OutputHeading("BNU CO453 Applications Programming 2020-2021!");

            string[] choices = { "Distance Converter", "BMI Calculater",
                                 "Student Grades",     "NetworkApp" };

            int choiceNo = ConsoleHelper.SelectChoice(choices);

            if (choiceNo == 1)
            {
                converter.ConvertDistance();
            }
            else if (choiceNo == 2)
            {
                calculator.CalculateIndex();
            }
            else if (choiceNo == 3)
            {
                studentGrades.OutputMenu();
            }
            else if (choiceNo == 4)
            {
                app04.DisplayMenu();
            }
            else
            {
                Console.WriteLine("Invalid choice ! ");
            }
        }
コード例 #2
0
        public static void Main()
        {
            UserLib.OutputHeading(" C# Console Applications 2020");

            string [] choices =
            {
                "App01: Distance Converter", "App02: BMI Calculator",
                "App03: Student Grades",     "App04: Network",
                "App05: RPS Game",           "Quit"
            };

            int choiceNo = UserLib.SelectChoice(choices);

            if (choiceNo == 1)
            {
                DistanceConverter15 converter = new DistanceConverter15();
                converter.ConvertDistance();
            }
            else if (choiceNo == 2)
            {
                BMI bmi = new BMI();
                bmi.CalculateIndex();
            }
            else if (choiceNo == 3)
            {
                StudentGrades app = new StudentGrades();
                app.OutputMenu();
            }
            else if (choiceNo == 4)
            {
                NetworkUI network = new NetworkUI();
                network.DisplayMenu();
            }
            else if (choiceNo == 5)
            {
                GameView view = new GameView();

                view.PlayGame();
            }
        }