CSC 160 Fall 2012 - Homework 3
Assigned Sept 19 & 24, due MONDAY Oct 1


Assigned W 9/19
Textbook Reading (to review today's class):
  • Read Sections 3.1-3.4 of the textbook.

    Required exercises from the textbook in DrRacket:
  • Do 3.3.3 on page 35 (with the specific instructions given here):
          a) Define a variable named solid-green-box whose value is a solid green rectangle. Use a width of 10 and a height of 20.
          b) Define a variable named outline-blue-box which is what it sounds like. Use a width of 10 and a height of 20.
          For parts c and d, use only the variable names. Do not use the pictures of the rectangles or the expressions using the rectangle operation, or only half credit will be given.
          c) Write an expression to put the solid box above the outline of a box.
          d) Create a two by two checkerboard where the upper left and bottom right corners have the solid box, and the upper right and lower left corners have the outline of a box.
  • Do 3.4.4 on page 39:
    Write the function contracts for ellipse, circle, and star-polygon only. For each argument, include its data type then describe what that argument is in parentheses. (Make sure this exercise is commented out, as discussed in Sections 3.4.3-3.4.4 of the text.). Note: The contract for triangle was given in class, so it is omitted from this exercise.

    Textbook Reading (to prepare for next class):
  • Study Chapter 2 and Sections 3.1-3.4 for Monday's quiz!
  • Read Sections 3.5-3.10 of the textbook.


    Assigned M 9/24
    Textbook Reading (to review today's class):
  • Read Sections 3.5-3.10 of the textbook.

    Required Exercises from the textbook in DrRacket:
  • Do 3.5.2 on page 42: (Note: You may use any picture of a person's face for this question. It does not have to be the picture in the textbook.)
  • Do 3.5.4 on page 42: (Hint: A circle's width and height are each twice the radius.)
  • Do 3.5.9 on page 44: (Note: You may use any picture of a person's face for this question. It does not have to be the picture in the textbook.)
  • EXTRA CREDIT: Exercise 3.5.8 on page 44

    Required exercise from the textbook on paper:
  • Do 3.8.2: Draw a box diagram to prove that (define tri (triangle 15 "solid" "orange")) is a legal expression. Assuming that tri is not already defined.

    Textbook Reading (to prepare for next class):
  • Read Sections 4.1-4.2 of the textbook.
  • Read this Definition of a Program.
  • Read pages 1-11 of the PSP handout.
  • Submit the Assignment on page 7 of the PSP handout.


    Submitting your Assignment
    Submit the Box Diagram and the PSP page 7 Assignment on paper in class, or through Moodle, by the due date.

    Submit the remainder of this assignment in a single Definitions Pane and a single Interactions Pane through Moodle. Points will be deducted for completing the assignment with multiple Definitions and/or Interactions Panes.

    Be sure to include your first and last name as a comment in the first line of both the Defintions pane and the Interactions pane.

    The file name for the Definitions Pane needs to be "hw3[LastName]Def.rkt" where:
  • [LastName] is replaced with your last name.
  • For example, if I were submitting this assignment, I would name the file "hw3WittensteinDef.rkt".

    Similarly, the file name for the Interactions Pane needs to be "hw3[LastName]Int.rkt".

    Please let me know if this is not clear or if you are unsure exactly what filename to use. Part of your grade is using the correct filenames.


    GRADING
    Question Point Value
    3.3.3 25
    3.4.4 15
    3.5.2 10
    3.5.4 15
    3.5.9 15
    3.8.2 10
    PSP pg.7 5
    X-CR: 3.5.8 15
    Filenames 5
    Total 100 + 15




    Last Modified: 9/24/12