/*----
  signature: get_nums: int[] int -> void
  purpose: expects an array of ints and its size,
      has the side effects of CHANGING that argument
      array's contents, asking the user for that
      many integers and storing them in that array,
      and returns nothing
  tests:
     if I have:

     int worm_weights[3];

     and, if, while I run:
     get_nums(worm_weights, 3);

     I enter, when prompted:  10 20 30
     ...then after this call,

     worm_weights should contain {10, 20, 30}

     And, if I have:

     int name_lengths[4];

     get_nums(name_lengths, 4);

     and when prompted, enter: 10 5 13 8

     afterwards, name_lengths should contain {10, 5, 13, 8}

  by: Sharon Tuttle
  last modified: 2022-09-14
----*/

#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;

void get_nums(int values[], int size)
{
    // ask user for size values,
    //     and store them in parameter array values
    //     (which in this case WILL change the
    //     corresponding argument array!)

    cout << "Enter " << size << " integer values as prompted:"
         << endl;

    for (int i=0; i < size; i++)
    {
        cout << "enter next value: ";
        cin >> values[i];
    }
}