Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

How to do your

...

Racket homework problems

  • Recall that all homeworks should be done in pairs if possible. Each pair should submit only one copy of their assignment from the account of either partner in the pair. This this directive describes how to answer both expository problems and programming problems. For detailed instructions on how to format your homework as a single (.ssrkt) file and submit it, see the Racket HW Checklist.

Expository problems

  • Some homework problems will be conventional expository questions that require a short written answer.
  • All of the assigned expository problems should be answered in the same Scheme Racket .ssrkt file as your Scheme programming exercises. Each Of course, you "comment out" each answer either by:
    1. Beginning each line in the answer to an expository question

...

    1. with the comment escape character ; (semicolon) ; or
    2. Enclosing the entire expository answer in a Racket comment box created using Racket block comment brackets #| and |# (

...

    1. sometimes called bookends). 
  • Note that you can create your entire homework file including solutiob ns to expository problems using the DrScheme DrRacket editor.

Hand evaluation problems

  • Most expository problems will be hand-evaluation problems where you are asked to evaluate a particularly Scheme program invocation. You must format your hand evaluation exactly like our examples (except you will need to insert a comment escape character :.
    • Example 1: Hand evaluation

      Code Block
              Given
      	        (define (poly x y)
        	          (+ (expt 2 x) y))
      
                     (poly 3 5)
                  => (+ (expt 2 3) 5))
                  => (+ 8 5)
                  => 13
      
    • Example 2: Hand evaluation

      Code Block
              Given
      	        (define (fact n)
        	          (if (zero? n) 1 (* n (fact (- n 1)))))
      
                     (fact 4)
                  => (if (zero? 4) 1 (* 4 (fact (- 4 1))))
                  => (if false 1 (* 4 (fact (- 4 1))))
                  => (* 4 (fact (- 4 1)))
                  => (* 4 (fact 3))
                  => (* 4 (if (zero? 3) 1 (* 3 (fact (- 3 1)))))
                  => (* 4 (if false 1 (* 3 (fact (- 3 1)))))
                  => (* 4 (* 3 (fact (- 3 1))))
                  => (* 4 (* 3 (fact 2)))
                  => (* 4 (* 3 (if (zero? 2) 1 (* 2 (fact (- 2 1))))))
                  => (* 4 (* 3 (if false 1 (* 2 (fact (- 2 1))))))
                  => (* 4 (* 3 (* 2 (fact (- 2 1)))))
                  => (* 4 (* 3 (* 2 (fact 1))))
                  => (* 4 (* 3 (* 2 (if (zero? 1) 1 (* 1 (fact (- 1 1)))))))
                  => (* 4 (* 3 (* 2 (if false 1 (* 1 (fact (- 1 1)))))))
                  => (* 4 (* 3 (* 2 (* 1 (fact (- 1 1))))))
                  => (* 4 (* 3 (* 2 (* 1 (fact 0)))))
                  => (* 4 (* 3 (* 2 (* 1 (if (zero? 0) 1 (* 0 (fact (- 0 1))))))))
                  => (* 4 (* 3 (* 2 (* 1 (if true 1 (* 0 (fact (- 0 1))))))))
                  => (* 4 (* 3 (* 2 (* 1 1))))
                  => (* 4 (* 3 (* 2 1)))
                  => (* 4 (* 3 2))
                  => (* 4 6)
                  => 24
      

...

  • Most of your homework problems will be programming problems.
  • Half (50%) of your grade on programming problems depends on good style and following the recipe (program grading is described in detail on the homework grading page). In particular, these points will be based on
    • 25% 30% for following the design recipe carefully and documenting your program as you are taught in this course (see below), and
    • 25% 20% for good programming style as taught in the course.
  • The other half of your grade will be based on demonstrated correctness:
    • 25% 30% for passing all of our tests and 25% for construction; and
    • 25% 20% for constructing a comprehensive set of unit tests for each function in your program.
  • All assigned programming problems should be done in the same .ssrkt file.
  • At the top of your programming solution file, please put a header with the assignment number, your name and e-mail address, and your partner's name and e-mail address , like this:

    Code Block
          ;; COMP 211 HW #01
          ;; Christopher Warrington <chrisw@rice.edu>
          ;; Gregory Malecha <gmalecha@rice.edu>
    
  • Strictly follow the formatting and documentation directives given below under the heading Requirements. The easiest way to follow these requirements is to imitate the Sample Program solution below.

...