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"); }
public void PrintMenuSP() { String choice; do { sequenceProgrammingMenu menuSP = new sequenceProgrammingMenu(); menuSP.PrintMenu(); choice = Console.ReadLine(); Console.Clear(); #region Sequence Programming Cases switch (choice) { case "0": break; #region Övning 1 - 10 case "1": sequenceProgramming.Övning1Kvadrat ö1 = new sequenceProgramming.Övning1Kvadrat(); ö1.Print(); break; case "2": sequenceProgramming.Övning2SalaryProvision ö2 = new sequenceProgramming.Övning2SalaryProvision(); ö2.Print(); break; case "3": sequenceProgramming.Övning3CalcHours ö3 = new sequenceProgramming.Övning3CalcHours(); ö3.Print(); break; case "4": sequenceProgramming.Övning4Sum ö4 = new sequenceProgramming.Övning4Sum(); ö4.Print(); break; case "5": sequenceProgramming.Övning5Currency ö5 = new sequenceProgramming.Övning5Currency(); ö5.Print(); break; case "6": sequenceProgramming.Övning6Algorythm ö6 = new sequenceProgramming.Övning6Algorythm(); ö6.Print(); break; case "7": sequenceProgramming.Övning7Petrol ö7 = new sequenceProgramming.Övning7Petrol(); ö7.Print(); break; case "8": sequenceProgramming.Övning8RectangleArea ö8 = new sequenceProgramming.Övning8RectangleArea(); ö8.Print(); break; case "9": sequenceProgramming.Övning9CircleArea ö9 = new sequenceProgramming.Övning9CircleArea(); ö9.Print(); break; case "10": sequenceProgramming.Övning10FahrToCelc ö10 = new sequenceProgramming.Övning10FahrToCelc(); ö10.Print(); break; #endregion default: Console.WriteLine("Error, try again"); Console.ReadKey(); break; #endregion } } while (choice != "0"); }