Placing & deleting element(s) from a object (stack)
<p>Initialising 2 stack objects:</p>

<pre><code>Stack s1 = new Stack(), s2 = new Stack();
</code></pre>

<p>s1 = 0 0 0 0 0 0 0 0 0 0 (array of 10 elements wich is empty to start with) top:0</p>

<pre><code>        const int Rows = 10;
    int[] Table = new int[Rows];

    public void TableStack(int[] Table)
    {
        for (int i=0; i &lt; Table.Length; i++)
        {
        }
    }
</code></pre>

<p>My question is how exactly do i place a element on a stack (push) or take a element from the stack (pop) as the following:<br>
  <strong>Push:</strong></p>

<pre><code>s1.Push(5);   // s1 = 5 0 0 0 0 0 0 0 0 0   (top:1)
s1.Push(9);   // s1 = 5 9 0 0 0 0 0 0 0 0   (top:2)
</code></pre>

<p><strong>Pop:</strong></p>

<pre><code>int number = s1.Pop();  // s1 = 5 0 0 0 0 0 0 0 0 0 0 (top:1) 9 got removed
</code></pre>

<p>Do i have to use get &amp; set, and if so how exactly do i implent this with a array?
Not really sure what to exactly use for this.
Any hints highly appreciated.  </p>

<p>The program uses the following driver to test the Stack class (wich cannot be changed or modified):</p>

<pre><code>        public void ExecuteProgram()
    {
        Console.Title = "StackDemo";
        Stack s1 = new Stack(), s2 = new Stack();
        ShowStack(s1, "s1");
        ShowStack(s2, "s2");
        Console.WriteLine();
        int getal = TryPop(s1);
        ShowStack(s1, "s1");
        TryPush(s2, 17);
        ShowStack(s2, "s2");
        TryPush(s2, -8);
        ShowStack(s2, "s2");
        TryPush(s2, 59);
        ShowStack(s2, "s2");
        Console.WriteLine();
        for (int i = 1; i &lt;= 3; i++)
        {
            TryPush(s1, 2 * i);
            ShowStack(s1, "s1");
        }
        Console.WriteLine();
        for (int i = 1; i &lt;= 3; i++)
        {
            TryPush(s2, i * i);
            ShowStack(s2, "s2");
        }
        Console.WriteLine();
        for (int i = 1; i &lt;= 6; i++)
        {
            getal = TryPop(s2);
            //use number

            ShowStack(s2, "s2");
        }
    }/*ExecuteProgram*/
</code></pre>

<p>Regards.</p>
