Functional Programming

The program should include pure functional (i.e. non-I/O) code that performs the following
items of functionality:
i. return a list of the names of all the places
ii. return the average rainfall (as a float) for a place given its name
iii. return all place names and their 7-day rainfall figures as a single string which, when
output using putStr, will display the data formatted neatly into eight columns
iv. return a list of the names of places that were totally dry (i.e. had zero rainfall) a given
number of days ago (1 meaning yesterday, 7 meaning a week ago)
v. update the data given a list of most recent rainfall figures (one value for each place),
removing the oldest rainfall figure for each place
vi. replace a given existing place with a new place (the new place will have a name, a
location and a list of 7 rainfall figures)
vii. given a location return the closest place that was totally dry yesterday (assume the
world is flat use the standard Pythagoras theorem to calculate the distance between
locations)

You can leave a response, or trackback from your own site.