CSci 1301: Problem Set 4

Due: Friday, October 10 in class or by email before the class time 10:30am

Problem 1: Written exercises

Written exercises can be submitted electronically or on paper, in one of the following ways:

Book exercises for this part are given in the section Intermezzo: BSL

  1. (3 points) Exercises 108 (question 3 only), 109 (questions 2,3)
  2. (5 points) For each of the following expressions and definitions indicate if they are legal or illegal. Explain your answers (otherwise you may not get credit even for a correct answer)
    (define cond 4)
    (cond [true 1 false 0])
    (define (f x)
      (+ x (f x)))
    (define (g "input")
      (+ (string-length "input") 1))
    (define (h InPuT)
      (+ (string-length InPuT) 1))
  3. (4 points) Exercise 112 (questions 2,3 only)
  4. (8 points) Exercise 113, 115, 117 questions 1,2 (note: evaluation of some expressions may lead to an error)

Problem 2: Traffic light (12 points)

Exercise 99 in Section 6.2. Start designing your solution by deciding on what your world state will be. Make sure to describe your world state in comments right before main. Include check-with in your big-bang to check that your world state is in a valid state, it is a requied part of this problem.

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.