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)
Written on July 7th, 2020 by
Functional Programming
Posted in Computer science and IT assignments, Undergraduate