Created the solution to Problem 3 using PHP.