Homework/HW01/MyArray.cc
void MyArray::randomize(int limit, int theSize)
{
    //Use a static variable to keep track of whether rand() has already been seeded
    static bool randInit = false;
    if (!randInit)
    {
        //If rand() has not been seeded, do so using the current time.
        srand(time(NULL));
        randInit = true;
    }

    //If theSize is not 0, call the resize() method to resize the array.
    if (theSize)
        resize(theSize);

    //Cycle through the array and randomize the elements from 0 (inclusive) to limit (inclusive).
    for (int i = 0; i < size; ++i)
        array[i] = rand() % (limit + 1);
}
/****************************** randomize **********************************************************
Action:         Initializes the elements of the array with random values between 0 (inclusive) and a
                given maximum limit (also inclusive).  The intended size of the array is provided by
                the second parameter, theSize.  If this is 0 (default), the array will not be
                resized and will just have its elements randomized.

Parameters:
IN:             int limit, holds the maximum number that will be generated to fill the array.
                Default value is 100.
IN:             int theSize, holds the size of the array to be generated.  Default value is 0.
OUT:            None

Returns:        Nothing

Precondition:   None
***************************************************************************************************/
randomize
Action:         Initializes the elements of the array with random values between 0 (inclusive) and a
given maximum limit (also inclusive).  The intended size of the array is provided by
the second parameter, theSize.  If this is 0 (default), the array will not be
resized and will just have its elements randomized.

int limit, holds the maximum number that will be generated to fill the array.
Default value is 100.
IN:             int theSize, holds the size of the array to be generated.  Default value is 0.
OUT:            None

Nothing

None
randomize Action : Initializes the elements of the array with random values between 0 ( inclusive ) and a given maximum limit ( also inclusive ) . The intended size of the array is provided by the second parameter theSize . If this is 0 ( default ) the array will not be resized and will just have its elements randomized . int limit holds the maximum number that will be generated to fill the array . Default value is 100 . IN : int theSize holds the size of the array to be generated . Default value is 0 . OUT : None Nothing None
void MyArray::randomize(int limit, int theSize)
{
    static bool randInit = false;
    if (!randInit)
    {
        srand(time(NULL));
        randInit = true;
    }
    if (theSize)
        resize(theSize);
    for (int i = 0; i < size; ++i)
        array[i] = rand() % (limit + 1);
}
void MyArray :: randomize ( int limit , int theSize ) { static bool randInit = false ; if ( ! randInit ) { srand ( time ( NULL ) ) ; randInit = true ; } if ( theSize ) resize ( theSize ) ; for ( int i = 0 ; i < size ; ++ i ) array [ i ] = rand ( ) % ( limit + 1 ) ; }
randomize
Action:         Initializes the elements of the array with random values between 0 (inclusive) and a
given maximum limit (also inclusive).
randomize Action : Initializes the elements of the array with random values between 0 ( inclusive ) and a given maximum limit ( also inclusive ) .
//Use a static variable to keep track of whether rand() has already been seeded //If rand() has not been seeded, do so using the current time. //If theSize is not 0, call the resize() method to resize the array. //Cycle through the array and randomize the elements from 0 (inclusive) to limit (inclusive).