Exercises done

I thought that this question was wanting us to use the substitution in a while loop like on page 239. Oh well, at least i came up with a novel solution :s.