Lab Assignment #3 (Defensive Programming)

In this lab, you will improve the script you wrote for lab assignment #2. You don't need to add any new functionality, but you need to make sure that the script will never crash, even if someone messes with the environment variables in the URL. This means that your script needs to be able to deal with situations such as:

In other words, if we can crash your script just by mucking with the URL, then you haven't done your job.

You can decide for yourself what to do with invalid inputs or unexpected values. If you want to just make an assumption about what the user must have really meant and go with that, that's fine. If you want to print your own custom error message and ask the user to try again (or berate them for trying to mess with your script), that's fine too.

This assignment is due Wednesday, July 2nd before class.