示例#1
0
        public void DisplayMenu2()
        {
            bool quit = false;

            UserLib.OutputHeading("      Derek's News Daily");

            string[] choices = new string[]
            {
                "Add Message", "Add Photo", "Display All", "Quit"
            };

            do
            {
                int choice = UserLib.SelectChoice(choices);

                switch (choice)
                {
                case 1: AddMessage(); break;

                case 2: AddPhoto(); break;

                case 3: Display(); break;

                case 4: quit = true; break;
                }
            } while (!quit);
        }
示例#2
0
        public void DisplayMenu()
        {
            bool quit = false;

            UserLib.OutputHeading("      Derek's News Daily");

            string[] choices = new string[]
            {
                "Add Message", "Add Photo", "Add Comment",
                "Display All", "Display by Author", "Display by Date",
                "Like/Unlike", "Remove Post", "Quit"
            };

            do
            {
                int choice = UserLib.SelectChoice(choices);

                switch (choice)
                {
                case 1: AddMessage(); break;

                case 2: AddPhoto(); break;

                case 3: AddComment(); break;

                case 4: Display(); break;

                case 5: DisplayByAuthor(); break;

                case 6: DisplayByDate(); break;

                case 7: LikePost(); break;

                case 8: RemovePost(); break;

                case 9: quit = true; break;

                default:
                    break;
                }
            } while (!quit);
        }
示例#3
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();
            }
        }