Specifications and code for homework assignment #1