/Temperature-map

Creating a crude temperature map. A TemperatureMap class indicates areas of different temperature by the use of different colors. Our map will represent a square area. The temperatures are contained in a 2d int array. Each element in the array represents the temperature in a square area 20 miles on a side. We assume the temperature is the same through-out the area. The constructor takes a 2d array of ints as a parameter Provide these methods: public void drawMap() creates a map consisting of colored squares. Each square represents the temperature indicated by an element in the array. There is a one-to-one correspondence between the array elements and the squares on the map. The upper left hand corner of the map is at (0, 0). The squares are 10 px X 10 px. Draw the rows and then the columns The color of the square is determined as follows: Color.BLUE if the temperature is less than or equal 32° Color.GREEN if the temperature is greater than to 32° and less than or equal to 50° Color.ORANGE if the temperature is greater 50° but less than or equal to 85° Color.RED if the temperature is greater than 85° Write a private helper method to get the color. public int maxDifference() gets the difference between the highest and lowest points in the map as a positive number.

Primary LanguageJava

No issues in this repository yet.