if statement and an alert have been added for question 3 along with their comments.