Submit your assignment through the QTest system, using class ID CS170 and exam ID hw4. If you submit with a teammate, select team size 2 and login with the IDs of both members of the team. No email submissions are accepted. No late submissions are accepted.
General instructions and hints
In those problems asking you to write a method, always call the method several times to test that it works properly with a variety of different values for the parameters. Test it on more examples than the ones shown in this handout. Even if the problem asks you for just one method, you can always write additional helper methods to simplify and organize your code. Make sure you write comments to explain your code.
Comment requirements: Always comment the top of each method (what the method does, the meaning of the input parameters, the meaning of the output value). Write comments within the methods to explain the strategy you are using to solve the problem, and to clarify blocks of code that may be difficult to understand.