finishing the third problem

Adding arrays and calculations as well as logging it into the console.