CSC 160 Spring 2015 - Homework 8 (100 points)
Assigned Apr 6, due Mon Apr 13

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.


[100 pts.] Chapter 11B
Read Sections 11.5-11.9 of the textbook. (For 11.7-11.9, make sure to read the online version of the textbook.)

Do each of the following exercises in DrRacket. You must develop at least two helper functions and show ALL Design Recipe steps for EACH function you develop:
  • Exercise 11.6.0 (not in textbook) - Write a Racket program named total-cost. It consumes the selling price of a house and the amount of the down payment, then produces the grand total paid by the buyer at the end of the loan. The following terms apply. The mortgage is financed for 30 years. The base interest rate is a simple 5% per year on the principal, no compounding. Formula: Interest = Principal times rate times years. Extra fees totalling $1000 are added to the principal at the start of the first year of the loan.
    Hints: the principal is the fees added to the difference between the selling price and the down payment; only the principal is used in calculating the interest; the total cost of the loan is the selling price plus the interest plus any fees.
    Submit your Definitions Pane for this exercise with the filename "hw8LASTNAMEdef-1160.rkt".

  • Exercise 11.6.1 from the textbook
    Hint: require and use the leg-length function written in class. Save the "apr8notes.rkt" file on Moodle to the same folder where you save the file for this exercise.
    Another hint: Use the predefined triangle/sss function to create a function to make the roof. Look up triangle/sss in the Help Desk to see how it works.
    Submit your Definitions Pane for this exercise with the filename "hw8LASTNAMEdef-1161.rkt".


    GRADING
    Question Point Value
    11.6.0 (Contracts/Purposes) 8
    11.6.0 (3 Examples Per Function) 8
    11.6.0 (Skeletons w/Inventories) 8
    11.6.0 (Function definitions of helper functions) 16
    11.6.0 (Function definition of main function) 10
    11.6.1 (Contracts/Purposes) 8
    11.6.1 (3 Examples Per Function) 8
    11.6.1 (Skeletons w/Inventories) 8
    11.6.1 (Function definitions of helper functions) 16
    11.6.1 (Function definition of main function) 10
    TOTAL 100




    Last Modified: 4/13/15