solve programming question 1