CSci 1301: Lab 5

Due: Friday, October 24th at 11:59pm by e-mail

What to submit

The lab is done in groups of 2 (preferred) or 3. In the beginning of each file please write (in comments) the names of all group members.

At the end of the lab please send me and your group partner(s) all your Racket files as e-mail attachments. My e-mail is elenam at morris.umn.edu. The subject of your e-mail must be "1301 Lab 5" followed by "Final" or "Not final", depending on whether this is a final submission or you are still working on it. If you need to finish it, make sure to set up a time with your group partner(s) to finish the lab.

Lab task (25 points)

In this lab you will be experimenting with lists and functions that take lists. Study the example that we did in class before you start on the exercises. Also, check out examples in the beginning of Ch. 10 in the textbook.

Make sure to write tests (using check-expect) for all non-image functions (ideally, before you write the function itself).

You can do lab exercises in any order. The tasks are as follows:

  1. Exercises 126, 127, 128 in Section 10.1
  2. Write a function count-odd that takes a list of numbers and returns the number of odd elements in the list. Some examples include:
    
      (check-expect (count-odd (cons 3 (cons 2 empty))) 1)
      (check-expect (count-odd empty) 0)
      
    You need to write more tests.
  3. Write a function that takes a list of shapes and overlays them all on top of each other. Do not use overlay with more than 2 arguments. Be careful about the order: in your tests you don't want to cover a smaller image with a larger one.

CSci 1301 course web site.

The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.