CSC 160 Fall 2008 - Homework 8
Assigned Nov 10, due MONDAY Nov 17


Read Chapters 12 and 14 of the textbook.

Do the following exercises in DrScheme on your own or in pairs (using the ideas in the Pair Programming article):
  • Exercise 10.5.1 from Dr. Bloch's textbook: Develop a function choose-picture that takes in one of the strings "basketball", "baseball", or "calendar" and returns a picture of it. For any other string, return a string stating "Out of Stock". Be sure to show ALL Design Recipe steps (including Data Analysis) and 4 well-chosen examples. Use the following pictures in your function definition: .

  • Exercise 4.4.2a from How to Design Programs: Develop the function tax, which consumes the gross pay and produces the amount of tax owed. For a gross pay of $240 or less, the tax is 0%; for over $240 and $480 or less, the tax rate is 15%; and for any pay over $480, the tax rate is 28%. Be sure to show ALL Design Recipe steps (including Data Analysis) and at least 5 well-chosen examples.



  • Submitting your Assignment
    Please submit 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 your Definitions Pane and Interactions Pane.

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

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

    If these filenames are not used, points will be deducted from the assignment grade.


    GRADING
    Question Point Value
    10.4.1 50
    Contract 3
    Purpose 3
    Data Analysis 5
    Examples 10
    Skeleton 3
    Inventory 3
    Function 20
    Testing/Interactions Pane 3
    HtDP 4.4.2a 50
    Contract 3
    Purpose 3
    Data Analysis 5
    Examples 10
    Skeleton 3
    Inventory 3
    Function 20
    Testing/Interactions Pane 3
    Total 100




    Last Modified: 11/10/08