solving Question8A-4