Esempio n. 1
0
 /*
  * Handles user input and displays work schedule in console if the input
  * entered was 1 or 2. If the input entered is 0 the menu is disabled, meaning
  * that the while-loop in the Start-method will not perform another iteration.
  */
 private void HandleInput()
 {
     if (menuChoice == 0)
     {
         enableMenu = false;
     }
     else if (menuChoice == 1 || menuChoice == 2)
     {
         WorkSchedule workSchedule = new WorkSchedule(menuChoice);
         workSchedule.Start();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// This is where the main Menu and it's options are chosen by a number
        /// The user exits the loop and therfore the program by a 0
        /// </summary>
        public void Start()
        {
            Console.Title = "Selection and iteration algorithms";
            int choice = -1;

            while (choice != 0)
            {
                WriteInfoText();
                choice = Input.ReadIntegerConsole();

                switch (choice)
                {
                case 1:
                    AddWholeNumbers sumInt = new AddWholeNumbers();
                    sumInt.Start();
                    break;

                case 2:
                    AddFloatingNumbers sumDouble = new AddFloatingNumbers();
                    sumDouble.Start();
                    break;

                case 3:
                    CurrencyConverter sumConvert = new CurrencyConverter();
                    sumConvert.Start();
                    break;

                case 4:
                    WorkSchedule workSchedule = new WorkSchedule();
                    workSchedule.Start();
                    break;

                case 5:
                    TempatureTable tempatureTable = new TempatureTable();
                    tempatureTable.Start();
                    break;
                }
            }
        }