CSC 160 Spring 2015 - Homework 10 (100 points)
Assigned Apr 20, due Mon Apr 27

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 the Definitions Pane.
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 you 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.


[40 (+20) pts.] Chapter 15A
Read Sections 15.1-15.3 of the textbook.

Watch the following video.

Do the following textbook exercises in DrRacket, showing ALL Design Recipe v2 steps:
  • Exercise 15.3.2: Copy and paste the solution, including all Design Recipe v2 steps, to CW6 Exercise 15.3.1. Then modify the solution, including all Design Recipe v2 steps, so that the function produces a picture of a question mark, like this one, if the input isn't any of the known pictures. [Make sure to add at least another example or two to test if the function returns the picture of a question mark when it is supposed to!]
  • Exercise 15.3.6
  • EXTRA CREDIT (20 points): Exercise 5.1.5 in How to Design Programs: First Edition. [Replace all the symbols by strings in the exercise. Ignore the last 3 sentences involving the master.ss teachpack.]

    Save the Definitions Pane to your computer or flash drive with the filename "hw10LASTNAMEdef.rkt". Do not submit this file yet as you will continue working in the same file for the next part of this assignment!


    [30 pts.] Chapter 15B
    Read Sections 15.4-15.6 of the textbook.

    Do the following textbook exercise in DrRacket, showing ALL Design Recipe v2 steps:
  • Exercise 15.5.1

  • Save the Definitions Pane which should already have the filename "hw10LASTNAMEdef.rkt". Do not submit this file yet as you will continue working in the same file for the next part of this assignment!


    [30 (+20) pts.] Chapter 15C
    Read Sections 15.7-15.10 of the textbook.

    Do the following exercises in DrRacket (show all Design Recipe v2 steps whenever you design a function):
  • Exercise 15.8.2 from the textbook: Design the size function.
  • EXTRA CREDIT (20 pts.): Exercise 15.7.3 from the textbook: Design the make-shape function. (You may use a nested conditional OR design helper functions. Your choice!) Submit your Definitions Pane with the filename "hw10LASTNAMEdef.rkt".





    GRADING
    Question Point Value
    15.3.2 10
    15.3.6 30
    Contract 2
    Purpose 1
    Data Analysis 5
    Examples 5
    Skeleton 2
    Inventory 2
    Add details 3
    Function 10
    HtDP 5.1.5 +20
    15.5.1 30
    Contract 2
    Purpose 1
    Data Analysis 5
    Examples 5
    Skeleton 2
    Inventory 2
    Add details 3
    Function 10
    15.8.2 30
    Contract 2
    Purpose 1
    Data Analysis 5
    Examples 6
    Skeleton w/Inventory 3
    Add details 3
    Function 10
    15.7.3 +20
    TOTAL 100 + 20



    Last Modified: 4/21/15