Start of topic | Skip to actions

Assignment 3 (Due Monday 9/17/2006 before class)

Weight: 150 points.

Required problems (Must be submitted for grading):

  • Book Problems:
    • 9.5.4
    • 9.5.5 (part 1)
      • "Part 1" means just the convert function.
      • The "least significant digit" carries the smallest weight. So (convert (cons 1 (cons 2 (cons 3 empty)))) should produce the number 321.
    • 10.1.6
      • From now on, in the test part of the recipe, you can use equal? instead of "=" to check your test results. It works on lists of any type. Note, however, that you are not allowed to use equal? in any other part of your homework.
    • 10.2.9
      • You can copy the definitions of inventory and ir from the text. Be sure to write a function template for each data type.

  • Develop a function that takes a list of "posn" positions and returns the list of x-coordinates for these points. Make sure that the order of your input points and the output x-coordinates match. Next, develop a function that takes a list of "posn" positions and returns a list of distance-from-origins for each of these points. Again, make sure you get the order of the output list right.

Suggested as practice (Must NOT be submitted for grading):

  • Book problems: 8.7.1, 9.5.7 (think carefuly about your contract), 10.1.7
  • Develop one function that takes a list and a boolean. If the boolean is true, this function returns only the even elements in the list. If the boolean is false, this function returns only the odd elements of the list. Note, the function must always return a valid list for all inputs. For example, in the list 'rabbit, 'dog, and 'ringo, the even elements are just 'dog, and the odd elements are 'rabbit and 'ringo.

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.