/* This program reads 3 pollution levels, calculates an air
   pollution index as their average, and displays an appropriate
   air-quality message.

   Input:   Three pollution levels and a cutoff value
   Output:  The pollution index and a "safe condition"
            message if this index is less than the cutoff
            value, otherwise a "hazardous condition" message
------------------------------------------------------------------*/

#include <iostream.h>

int main(void)
{
   cout << "\nThis program processes pollution indices.\n";

   const int
      Cutoff = 50;                 // bottom line for a safe condition

   int
      Reading1, Reading2, Reading3;      // three pollution readings

   cout << "\nPlease enter 3 (integer) pollution readings: ";
   cin >> Reading1 >> Reading2 >> Reading3;

   int
      Index = (Reading1 + Reading2 + Reading3) / 3;

   cout << "\nPollution index = " << Index << ":  ";

   if (Index < Cutoff)
      cout << "Safe condition.\n";
   else
      cout << "Hazardous condition!\n";

   return 0;
}
