Esempio n. 1
0
        public void PrintMenuBT()
        {
            String choice;

            do
            {
                BobTaborMenu menuBT = new BobTaborMenu();
                menuBT.PrintMenu();

                choice = Console.ReadLine();
                Console.Clear();

                #region Bob Tabor Cases
                switch (choice)
                {
                case "0":
                    break;

                case "1":
                    BobTabor.ForIteration BT1 = new BobTabor.ForIteration();
                    BT1.Print();
                    break;

                default:
                    Console.WriteLine("Error, try again");
                    Console.ReadKey();
                    break;
                }
                break;
                #endregion
            } while (choice != "0");
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.BackgroundColor = ConsoleColor.Gray;
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            Console.Clear();

            menus.CoolHeader coolHeader = new menus.CoolHeader();
            coolHeader.PrintCoolHeader1();

            String choice;

            do
            {
                Console.Clear();
                menus.CoolHeader cH = new menus.CoolHeader();
                cH.PrintCoolHeader2();

                #region Head Menu
                menus.HeadMenu headMenu = new menus.HeadMenu();
                headMenu.PrintMenu();

                choice = Console.ReadLine();
                Console.Clear();

                switch (choice)
                {
                case "1":
                    //Bob Tabor Menu
                    menus.BobTaborMenu menuBT = new menus.BobTaborMenu();
                    menuBT.PrintMenuBT();
                    break;

                case "2":
                    //Sequence Programming Menu
                    menus.sequenceProgrammingMenu menuSP = new menus.sequenceProgrammingMenu();
                    menuSP.PrintMenuSP();
                    break;

                case "3":
                    //If Loop Menu
                    menus.ifConditionMenu menuIf = new menus.ifConditionMenu();
                    menuIf.PrintMenuIf();
                    break;

                case "4":
                    //For Loop Menu
                    menus.LoopsMenu menuLoops = new menus.LoopsMenu();
                    menuLoops.PrintMenuLoops();
                    break;

                case "5":
                    //Arrays Menu
                    menus.ArraysMenu menuArrays = new menus.ArraysMenu();
                    menuArrays.PrintSwitchArrays();
                    break;

                case "6":
                    menus.OwnArrays menuOwnArray = new menus.OwnArrays();
                    menuOwnArray.PrintSwitchOwnArrays();
                    break;

                case "7":
                    Exercises.Exempel.Reference.ReferenceExempel();
                    break;

                case "exit":
                    Console.WriteLine("Avslutar program.");
                    break;

                default:
                    Console.WriteLine("Error, try again");
                    Console.ReadKey();
                    break;
                }
                #endregion
            } while (choice != "exit");
        }