CSC 160 Fall 2011 - Homework 7
Assigned Nov 16 & 21, due Mon Nov 28


Assigned W 11/16
Textbook Reading (to review today's class):
  • Read Chapter 9 of the textbook.
  • Read the solution on Moodle to Exercise 9.2.6 in HW6.

    Do the following exercises in DrRacket (alone or in pairs):
  • Exercise 9.2.5 from the textbook. (For full credit, you must use the hint under the exercise for your examples/test cases.)
  • Exercises 7.7.15 and 7.7.16 from the textbook.

    Textbook Reading (to prepare for next class):
  • Read Sections 11.1-11.4 of the textbook.


    TENTATIVE-To Be Assigned M 11/21
    Textbook Reading (to review today's class):
  • Read Sections 11.1-11.4 of the textbook.

    Do the following exercises in DrRacket (alone or in pairs):
  • Exercise 7.17 from the textbook. (For full credit, your function definition for 7.17 must call the functions you defined in 7.15 and 7.16)
  • EXTRA CREDIT (25 points): Exercise 11.3.5 from textbook page 120. Read the hint on the top of page 121.
    Directions for 11.3.5: Read these directions carefully before starting the assignment.
  • Whenever defining a Racket function, you must show the first five steps of the Design Recipe introduced in Chapter 5 in the Definitions Pane, as well as Testing in the Interactions Pane.
  • If you are defining auxiliary functions, you need to show the steps of the Design Recipe for each of the auxiliary functions, as well as the steps of the Design Recipe for the main (or primary) function.
  • When writing a program, the name of the main (or primary) function is the name of the program. Use sensible names of your choice for auxiliary functions.
  • If a helper function is not predefined, but you have seen it written before (e.g. in class, on a reading assignment, or on a previous programming assignment), just copy the function definition (no contract, skeleton, etc.) into the top of your Definitions Pane.
  • For the given exercise, to receive full credit, you must use at least one helper function that is not predefined in DrRacket or the picturing-programs library. However, functions that we have written before (including area-of-circle and mirror-image) do count.
  • If you do not fully understand any of these directions, please e-mail me as soon as possible.
  • MORE EXTRA CREDIT (5 points): Answer the following question in a comment at the bottom of your Definitions Pane: In Exercise 11.3.5, if the tax rate were to rise to 0.6% per thousand dollars of salary, what would you need to modify in your program to handle this change?

    Textbook Reading (to prepare for next class):
  • Read Chapters 12-13 of the textbook.


    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 "hw7[LastName]Def.rkt" where:
  • [LastName] is replaced with your last name.
  • For example, if I were submitting this assignment, I would name the file "hw7WittensteinDef.rkt".

    Similarly, the file name for the Interactions Pane needs to be "hw7[LastName]Int.rkt". The Interactions Pane must include testing for EACH function.

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


    Grading Contracts Purposes Examples Skeletons Inventories Definitions Function Re-Use Testing
    Exercise 9.2.5 (22 pts.) /2 /1 /3 /1 /2 /10 /3
    Exercise 7.7.15 (22 pts.) /2 /1 /3 /1 /2 /10 /3
    Exercise 7.7.16 (22 pts.) /2 /1 /3 /1 /2 /10 /3
    Exercise 7.7.17 (34 pts.) /2 /1 /3 /1 /2 /10 /12 /3
    Exercise 11.3.5 (X-CR: 35 pts.) /2 /2 /4 /2 /2 /10 /10 /3


    Last Modified: 11/16/11