Code for Question 1

Code for Question 2

Unfortunately, my time was severely restricted by Member's Week this week, and I choose to spend more time on project progress. Planning to catch up over the weekend!