Completed the given tasks for the homework (Contains answers only).