Assignment 6 - Defensive programming: 2016 to 2020 OR 2017 to 2021?

Assignment 6 - Defensive programming: 2016 to 2020 OR 2017 to 2021?

by Iciar Iturmendi Sabater -
Number of replies: 1

Hello,

I have noticed that the assignment description on defensive programming states that "if the second argument is not one of the years 2016-2020 it should also give an error message and stop". However, when observing the data structure, there is available data on the years 2017 to 2021. Should our defensive programming code then give an error message and stop if the years are not 2017-2021 (instead of 2016-2020)?

I hope my question is clear. Thank you,

In reply to Iciar Iturmendi Sabater

Re: Assignment 6 - Defensive programming: 2016 to 2020 OR 2017 to 2021?

by Erik Spence -
The defensive programming should be for valid years in the data. If the data go to 2021 then you should allow the year 2021. I'll fix the assignment.