Exercise:   Matching Examples and Function Definitions

Exercise: Matching Examples and Function Definitions

Directions: Match the EXAMPLEs on the left with the definitions on the right. NOTE: Some definitions may not match any examples!
  •  

    (EXAMPLE (mystery "red") 
             (circle 10 "solid" "red"))
    (EXAMPLE (mystery "orange") 
             (circle 10 "solid" "orange"))
     
     

     

    (define (mystery r)
      (circle r "outline" "red"))
     
     

  •  

    (EXAMPLE (mystery 30) 
             (circle 30 "outline" "red"))
    (EXAMPLE (mystery 10) 
             (circle 10 "outline" "red"))
     
     

     

    (define (mystery num)
      (* num 2))
     
     

  •  

    (EXAMPLE (mystery 30) 
             (rectangle 30 10 "outline" "red"))
    (EXAMPLE (mystery 10) 
             (rectangle 10 10 "outline" "red"))
     
     

     

    (define (mystery w)
      (rectangle w 10 "outline" "red"))
     
     

  •  

    (EXAMPLE (mystery 30) 
             (rectangle 20 30 "solid" "red"))
    (EXAMPLE (mystery 20) 
             (rectangle 20 20 "solid" "red"))
    (EXAMPLE (mystery 10) 
             (rectangle 20 10 "solid" "red"))
     
     

     

    (define (mystery num)
      (+ num num))
     
     

  •  

    (EXAMPLE (mystery 2) 
             (+ 2 2))
    (EXAMPLE (mystery 4) 
             (+ 4 4))
    (EXAMPLE (mystery 5) 
             (+ 5 5))
     
     
     

     

    (define (mystery h)
      (rectangle 10 h "solid" "red"))
     
     

  •  

    (define (mystery c)
      (circle 10 "solid" c))
     
     

  •  

    (define (mystery h)
      (rectangle 20 h "solid" "red"))