homework for the class of Programation IV