Due Date: Sunday, February 7, 2010.
Objective: The goal of this assignment is to practice using 2-dimensional
arrays.
Background: To study climate change in El Paso area,
UTEP students record the temperature and the wind speed
at different locations within the city
on different days. Temperature measurements are placed in a file, each line
corresponding to one day of measurements, in each line we first place measurements
from the 0-th location (temperature first), then measurements at the 1st
location, etc.
Example. A file
68.0 5.2 71.0 6.3
66.5 3.1 69.5 4.9
means the following:
- On Day 0:
- at Location 0, we had temperature 68.0 and wind speed
5.2;
- at Location 1, we had temperature 71.0 and wind speed 6.3.
- On Day 1:
- at Location 0, we had temperature 66.5 and wind speed
3.1;
- at Location 1, we had temperature 69.5 and wind speed 4.9.
Assignment: Write a program that, first, stores the measurement
results (which
are originally given in a file) in two two-dimensional arrays:
the temperature array and the wind speed array.
Your program should include the following methods:
- a method that fills in the arrays from a given file;
- a method that, given a location, returns the average temperature at this
location;
- a method that, given a location, returns the average wind speed at this
location;
- a method that, given a day, returns the average temperature on this day;
- a method that, given a day, returns the average wind speed on this day;
- a method that returns an average temperature over all days and all
locations;
- a method that returns an average wind speed over all days and all
locations;
- a method that, given a day, returns the location which was the warmest on
this day;
- a method that, given a location, returns the day on which this location was
the warmest;
- a method that returns the highest temperature at all locations on all days.