code for part a problem 5