Please send questions to st10@humboldt.edu .
/*--------------------------------------------------
created by st10 at Mon Apr  9 16:46:55 PDT 2007
--------------------------------------------------*/
#include <iostream>
#include <cmath>
using namespace std;


/*--------------------------------------------------
 Contract: count_negs : int -> int
 Purpose: to ask for <quantity> values from the user,
         and return the number of the those values that
         are negative.

 Examples: if user calles count_negs(3), and when prompted enters
          -7, 2, -9, then count_negs(3) == 2
--------------------------------------------------*/
int count_negs(int quantity)
{
    int how_many_negs = 0;
    int count = 0;
    double in_value;

    while (count < quantity)
    {
        cout << "enter a value: ";
        cin >> in_value;

        if (in_value < 0)
        {
             how_many_negs += 1;
        }

        count += 1;
    }

    return how_many_negs;
}