Start of topic | Skip to actions

Assignment 1 (Due Wednesday 9/5/2007 before class)

Weight: 200 points.

Note for 2008: 3.3.2 will be made optional.

For the next few assignments, make sure that DrScheme is using the Language Level Beginning Student. Future assignments will use other levels, but it is always that case that your assignment is correct only if you use the correct level. Only switch levels when we ask you to do so.

  • Read Recipe Guidelines for "Chapter 2 onwards". Correctness of your code is assumed. Most of the grade is on following the recipe.

  • Book problems: 2.2.3, 2.2.5 (Part 2 only), 2.3.1, 3.1.4, (3.3.2), 3.3.3, 3.3.4.
  • NB: Be sure to do all the assigned parts of the problem. In the book, each problem ends with a block icon. Online, each problem ends with a hand icon.

  • Use the design recipe from lecture 2 to develop the following program: It takes one number as input. If the input is even, we square it, and if the number is odd, we return 0. However, the program CANNOT use conditionals, and can only use arithmetic operations (addition, multiplication, division, exponentiation, etc). Hint: Exponentiation of negative numbers should be very helpful here. Important: For this exercise, you can only discuss your function with others AFTER you have written your examples.

  • Follow the recipe carefully and in the correct order. This means, write down the purpose, contract, develop examples (hand in 5), write the actual function, and include illustrative test cases for the function (using at least the examples you developed ahead of time). The examples should illustrate the output you expect, and the test cases should produce the actual output (they should not be commented). Add notes at the end of each problem to indicate wether the examples actually helped you in catching bugs.

Submit using SVN.

Access Permissions: (Please don't edit)


End of topic
Skip to actions | Back to top
Creative Commons LicenseThis work is licensed under a Creative Commons Attribution 2.5 License. Please follow our citation guidelines.