HW9 Extra Credit 11.6.1: Hints and Comments

Dear students,
In class on Monday, we discussed that there should be two helper functions in addition to the main function, build-house. One of the helper functions creates the front of the house with a door in the middle. The other helper function creates the triangular roof.

In class, I suggested using the predefined isosceles-triangle function in the function that creates the roof. But, I did not realize that this function took in an angle as an argument, rather than just side lengths. So, instead of the isosceles-triangle function, you should use the predefined triangle/sss function. Look it up in the Help Desk to see how it works, but note that it takes in all 3 side lengths, a mode, and a color. One of the side lengths is the width (that is shared by the triangular roof and rectangular front of the house). The other two sides (called legs) are both the same length.

Suppose that for the helper function to build-house that makes a roof, you use the function name roof. Then, I recommend writing a helper function for the roof helper function to find the leg lengths, since it involves using the Pythagorean Theorem: c = sqrt(a*a + b*b). Draw yourself a picture of a triangular roof to figure out what a, b, and c represent.

Please do not hesitate to ask me questions as you work through this problem, and as always, partial credit will be given for all Design Recipe steps that are correct or partially correct. Also, as discussed in class yesterday, extra credit only boosts your grade, so even if you score 5/30, your course grade can only go up from submitting extra credit.

Lastly, I will give 20 out of 30 points extra credit, if you can create houses with equilateral-triangle roofs that satisfy all the other requirements in the exercise, including that the bottom of the roof and top of the front of the house overlap and are the same size. (For this version, there will not be a fixed roof height, since an equilateral triangle's height is dictated by its side lengths.) The reason for giving 20 out of 30 points is that this is easier than the full 30-point assignment which uses triangle/sss and the Pythagorean Theorem to create the houses in the textbook, as described above.

~Prof. Wittenstein