PROGRAM POLUT2 ******************************************************************** * Program that reads 3 pollution levels, calculates a pollution * * index as their integer average, and then displays an appropriate * * air-quality message. Identifiers used are: * * LEVEL1, LEVEL2, LEVEL3 : The three pollution levels * * LOWCUT, HICUT : Cutoff values that distinguish * * between good/fair, and fair/poor * * conditions, respectively * * INDEX: The integer average of the pollution levels * * * * Input: The three pollution levels * * Constants: The two cutoff values * * Output: The pollution index and a "good condition" message if * * this index is less than LOWCUT, a "fair condition" * * message if it is between LOWCUT and HICUT, and a * * "poor condition" message otherwise * ******************************************************************** INTEGER LEVEL1, LEVEL2, LEVEL3, LOWCUT, HICUT, INDEX PARAMETER (LOWCUT = 25, HICUT = 50) * Get the 3 pollution readings PRINT *, 'ENTER 3 POLLUTION READINGS:' READ *, LEVEL1, LEVEL2, LEVEL3 * Calculate the pollution index INDEX = (LEVEL1 + LEVEL2 + LEVEL3) / 3 * Classify the pollution index and display an appropriate * air-quality message IF (INDEX .LT. LOWCUT) THEN PRINT *, 'GOOD CONDITION' ELSE IF (INDEX .LT. HICUT) THEN PRINT *, 'FAIR CONDITION' ELSE PRINT *, 'POOR CONDITION' END IF END