// An application that averages the high and low temperatures
// for a city.

// CityTemps is the class containing the main method.  It uses the
// City class to create a city..
import simpleIO.Reader;

public class CityTemps
{
	public static void main (String [] args) 
	{
		City ourCity = new City ();
		ourCity.readAndCompare ();	
	
	} // method main
		
} // class CityTemps

// The City class maintains weather statistics for a city.
class City 
{
	private String cityName;
	private int highTemp, lowTemp, normalHigh, averageTemp;
	
	// Class constructor.
	City ()
	{
	
	} // constructor
	
	// A method to display the data in the class.
	public void getData ()
	{
		System.out.print ("City Name: ");
		cityName = Reader.readString ();
		System.out.print ("High Temperature: ");
		highTemp = Reader.readInteger ();
		System.out.print ("Low Temperature: ");
		lowTemp = Reader.readInteger ();
		System.out.print ("Normal High Temperature: ");
		normalHigh = Reader.readInteger ();
	} // method getData 
	
	// A method that finds the average of the high and low temperatures.
	public int findAverageTemp ()
	{
		averageTemp = (highTemp + lowTemp) / 2;
		return averageTemp;
	} // method findAverage 

	// A method that displays the average temperature on the screen.
	public void displayAverageTemp ()
	{
			System.out.println ("The average temperature in " + 
				cityName + " was " + averageTemp);
	} // method displayTemps 

	public void displayNormalHigh ()
	{
		if (highTemp > normalHigh)
			System.out.println ("The high temperature is above the normal high.");
		else
			if (highTemp == normalHigh)
				System.out.println ("The high temperature is the same as the normal high.");
			else
				System.out.println ("The high temperature is below the normal high.");
	} // method displayNormalHigh
	
	public void readAndCompare ()
	{
		for (int count = 0; count < 5; count ++)
		{
			getData ();
			averageTemp = findAverageTemp ();
			displayAverageTemp ();
			displayNormalHigh ();
		}
	} // method readAndCompare
} // class City
