Пример #1
0
        public static void Menu(MyArray array)
        {
            int  choice = 0;
            bool exit   = false;

            while (!exit)
            {
                Console.Clear();
                Console.Write("1 - Calculate array\n2 - Change array\n3 - Show array\n0 - Exit\nYour choice: ");
                choice = int.Parse(Console.ReadLine());
                switch (choice)
                {
                case 1:
                    CalculateMenu(array);
                    Console.ReadLine();
                    break;

                case 2:
                    ChangeMenu(array);
                    Console.ReadLine();
                    break;

                case 3:
                    Console.Clear();
                    array.Show();
                    Console.ReadLine();
                    break;

                case 0:
                    exit = true;
                    break;

                default:
                    break;
                }
            }
        }
Пример #2
0
 private static void NegativeToNull()
 {
     arr.ChangeToNull();
     Console.WriteLine("Negative elements changed to 0:");
     arr.Show();
 }