introductory programming exercise