work for Programming Assignment 2

first code