Exercise:   Do Examples Have the Same Contracts?

Exercise: Do Examples Have the Same Contracts?

Directions: For each pairs of Examples below, decide whether the two examples have the same contract. If they do, fill in the contract in the space provided. If not, write a few words explaining why.
  1. ; : ->  
    (EXAMPLE (mystery "+" 4 5) 
              (+ 4 5))
    (EXAMPLE (mystery "sqrt" 25)) 
             (sqrt 25))
     
     
  2. ; : ->  
    (EXAMPLE (mystery (triangle 70 "solid" "green"))
             (triangle 140 "solid" "green"))
    (EXAMPLE (mystery (circle 100 "solid" "blue"))
             (circle 200 "solid" "blue"))
     
     
  3. ; : ->  
    (EXAMPLE (mystery "red")
             (triangle 140 "solid" "red"))
    (EXAMPLE (mystery "blue" "circle"))
             (circle 140 "solid" "blue"))
     
     
  4. ; : ->  
    (EXAMPLE (mystery "circle" 4) 
              (* pi (sqr 4)))
    (EXAMPLE (mystery "square" 5)) 
             (sqr 5))
     
     
  5. ; : ->  
    (EXAMPLE (mystery "dog") 
              3)
    (EXAMPLE (mystery "cat") 
             "kitten")
     
     
  6. ; : ->  
    (EXAMPLE (mystery "dog") 
              3)
    (EXAMPLE (mystery "kitten") 
             6)
     
     
  7. ; : ->  
    (EXAMPLE (mystery 4 5 "big") 
              (scale 2 (rectangle 4 5 "solid" "blue")))
    (EXAMPLE (mystery 10 "small" 4) 
              (scale .5 (rectangle 10 4 "solid" "blue")))