add program for question #4