Example #1
0
        public static void DisplayArray(ArrayInt a)
        {
            string message = "";
            int    j       = 1;

            Console.WriteLine("Your array has:");
            for (int i = 0; i <= a.GetSize(); i++, j++)
            {
                if (j % 5 == 0)
                {
                    j        = 0;
                    message += " " + a.GetAt(i).ToString() + System.Environment.NewLine;
                }
                else
                {
                    message += " " + a.GetAt(i).ToString() + " ";
                }
            }
            Console.Write(message + System.Environment.NewLine);
        }
Example #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello");
            int size = SetSize();

            myArray = new ArrayInt(size);
            Console.WriteLine("How many numbers do you want to put into your array? Whole numbers only...");
            int input = int.Parse(Console.ReadLine());

            FillArray(input);
            DisplayArray(myArray);
            TestGetAt();
            TestSetAt();
            TestGetSize();
            TestSetSize();
            TestAppend();
            TestInsertAt();
            TestRemoveAt();
            Console.WriteLine("Finished!");
        }