Screenshots of example programs below (with output).  Here is a link to text of the output.