This homework is to be done individually. Do not work with a homework partner on this assignment.
Read the expectations on homework.
You will be turning in the solutions to problems 6, 7, 9, and 10 only.
7
5
(+ 7 5)
(- (+ 7 5) 3)
(* (- (+ 7 5) 3) 2)
(In the third expression, the operator is +, and the two arguments required by the + operator are two numbers, 7 and 5.)
(circle 25 'solid 'red)
Notice that this conforms to the definition of a compound expression. (The operator is circle. The three arguments supplied to the circle operator are a number, 25, and two symbols, 'solid, and 'red.)
In the Interactions window, write a compound expression that will display two solid circles stacked on top of each other. Both circles should have a radius of 25. The circle on the top should be red, and the circle on the bottom should be yellow. (Hint: look at the definitions of the operators circle and overlay/xy in the help desk).
;; mod-traffic-light: symbol symbol symbol -> image ;; consumes three symbols representing the colors of the top, middle, and ;; bottom lights and produces an image of a traffic light in those colorsCopy the contract and purpose into the definitions window. Now write the function definition for mod-traffic-light. (Hint: here is the first line of the function definition, with parameter names top, middle, and bottom:)
(define (mod-traffic-light top middle bottom)
taxes-owed that consumes a number
representing income and produces a number which is the product of income
times the TAX-RATE.
taxes-owed.
taxes-owed
.
hw1.scm that contains the answers to the
problems in Steps 6, 7, 9, and 10. From the File menu, choose
Save Definitions. Use
web-based turnin
to turn in your file before 11:59pm on Sunday, August 26. Solutions
to hw1 will be available online in the Schedule section of the class
webpage on Monday morning. No late assignments will be accepted.