Solution for exam question 1.
Supplied base code for exam question 2.
Correct answer for exam q2