assignment for cs 107 Stanford programming paradigm