How do I write a function that will insert random values into a stack of integers?
<p>Write a function that accepts an integer as its only argument. Throw an exception of the integer is less than one. The function should
create a stack of integers (enforce the type stored in the stack by using generics!),
populate the stack with the random integers (random within the range 0 to 99), such that the stack holds a count of random integers equal to the argument passed in, and
return the stack.</p>

<p>this is my code so far, i'm new to this. If you can help, i will be pleased</p>

<pre><code>Console.WriteLine("ENTER A NUMBER");
int arg = Int16.Parse(Console.ReadLine());

if (arg &lt; 1)
{
    try
    {
    }
    catch (System.IndexOutOfRangeException e)
    {
        throw new System.ArgumentOutOfRangeException("value must be more than 1");
    }

    Stack&lt;int&gt; mystack = new Stack&lt;int&gt;(arg);
    Random rd = new Random();
    if( arg &gt; 1)
    {

        int rndnum = rd.Next(arg);
        arg = mystack.Pop();
        return

    }
    Console.ReadLine();
</code></pre>
