You will not be turning in your solutions to this assignment (it won't be graded). However, I will expect that you will know all the material covered in this assignment by Tuesday, January 19.
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.)
overlay/xy
to find information about that operator.
(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).
;; 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 traffic-light. (Hint: here is the first line of the function definition, with parameter names top, middle, and bottom:)
(define (traffic-light top middle bottom)
traffic-light
to create an
image of a traffic light. Call the function with arguments 'chartreuse, 'magenta, and 'brown.
taxes-owed
that
consumes a number
representing income and a number representing the number of dependents and produces a number. The number produced is the difference between the product of the income
and the TAX-RATE, and the product of the number of dependents and
EXEMPTION-AMOUNT.
taxes-owed
.
taxes-owed
.