CSC 160 Fall 2012 - Homework 8
Assigned Nov 12 & 14, due Mon Nov 19

1) Assignments with time stamps during class time (Mon or Wed 4:15-5:30pm) will be given a grade of ZERO.
2) In the spirit of the pair programming article that you read and summarized in HW5, this week's homework assignment may be done in pairs. If you choose to work in pairs, you must find time outside of class to work together in person at one computer. As per the syllabus, you cannot "pair-off" with the same person more than once during the semester. If you choose to do the assignment in pairs, please submit one copy through Moodle where both last names are used in each file name and both names appear as a comment at the top of each pane (Definitions and Interactions).
3) Start this homework as soon as possible so that you have time to get any help you may need from the instructor or course tutor prior to when the assignment is due.
4) Do not start the exercises until to have fully read and fully understood the corresponding textbook sections. If there is something you do not fully understand, you must contact the instructor or course tutor prior to starting the assigned exercises.


Assigned M 11/12
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):
  • Exercises 7.7.15 and 7.7.16 from the textbook.
  • Exercise 7.7.17 from the textbook. (For full credit, your function definition for 7.7.17 must call the functions you defined in 7.7.15 and 7.7.16)
  • 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.
  • EXTRA CREDIT (10 points): Using more than one helper function.
  • 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):
  • Study Sec. 7.7, Ch. 9, and Sec. 11.1-11.4 for Wednesday's Quiz!


    Assigned W 11/14
    Textbook Reading (to review today's class):
  • Read Chapter 12 & Sections 13.1-13.3 of the textbook.
  • Do CW4 as a take-home lab.

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


    Submitting your Assignment
    You are required to 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.rkt" where:
  • [LastName] is replaced with your last name.
  • For example, if I were submitting this assignment, I would name the file "hw8WittensteinDef.rkt".

    Similarly, the file name for the Interactions Pane needs to be "hw8[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 7.7.15 (18 pts.) /2 /1 /3 /1 /1 /8 /2
    Exercise 7.7.16 (18 pts.) /2 /1 /3 /1 /1 /8 /2
    Exercise 7.7.17 (24 pts.) /2 /1 /3 /1 /1 /8 /6 /2
    Exercise 11.3.5 (40 pts.) /4 /2 /6 /2 /2 /10 /10 /4


    Last Modified: 11/12/12