Purpose: The main class for (a prototype of) the QuAQI system.
AQIDisplay
object it is using. (Note: This attribute
must NOT be constructed when it is declared.)
getAQIDisplay()
that returns the AQIDisplay
object it is using.
NAAQS
class to get the array of pollutants.
NAAQS
class to get the array of descriptions.
NAAQS
class to get the array of AQI ranges.
NAAQS
class to get the array of Color
objects to use on an AQIDisplay
.
Categorizer
object for each pollutant. (To do so,
it will need to use the NAAQS
class to get the
value ranges for each pollutant.)
AQIDisplay
object for the "City of Harrisonburg".
AQIDisplay
.
System.out
) to enter the following information
(in order):
You may assume that the user will always respond appropriately to any given prompt. The appropriate responses follow.
This class must read the responses from System.in
.
After reading the response to the "Data:" prompt, this class
must process the pollutant data.
For each pollutant, this class must use the appropriate
Categorizer
to calculate the AQI for that pollutant. It
must also determine which pollutant has the maximum AQI. (Ties must
be resolved "in order". That is, in the event of a tie, the first
pollutant with the highest AQI must be chosen.) It must then construct
or modify an AQIReport
object for the pollutant with the
maximum AQI and cause that AQIReport
to be displayed
on the AQIDisplay
.
This process of prompting, reading the responses, and processing the pollutant data must continue until the user does not enter "Y" in response to the "Continue?" prompt.
shutdown()
method of the AQIDisplay
object.
0.200 4.000 0.305 7.000 7.000 4.000
and the AQIDisplay
appears as follows:
0.200 4.000 0.027 7.000 7.000 4.000
then repsonds to the "Continue?" prompt as follows:
Y
then responds to the "Data:" prompt as follows:
8.400 4.000 0.025 7.000 7.000 4.000
then repsonds to the "Continue?" prompt as follows:
Y
and then responds to the "Data:" prompt as follows:
0.200 4.000 0.025 7.000 7.000 4.000
and the AQIDisplay
appears as follows:
Copyright 2013