answer to programming assignment 2