Programming homework

details are in the picture.you have 1 hour to finish.very simple work.