package warmdays;


/**
 * This program counts the number of warm days in a given set of days
 * 
 * <a href="https://en.wikipedia.org/wiki/Heating_degree_day"> read more</a>
 * @author James Cannon
 * @version 10 February 2016
 */
public class WarmDays {

    
    /**
     * This is the list of temperatures
     */
    private static int[] temps = {30, 17, 38, 25, 21, 23, -4, 13, 19, 1, 5, 10};

    public static int countWarmDays(int threshold, int[] data) {
        int count = 0;
        for (int i=0;i<data.length;i++)
        {
            if (data[i]>threshold)
            {
                count = count + 1;
            }
        }
        return count;
    }

    public static void main(String[] args) {
        System.out.println("# of warm days = " + countWarmDays(20, temps));
    }

}