Referenced from lesson Solving Word Problems

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. :: ->
    examples: mystery("+", 4, 5) is 4 + 5 mystery("sqrt", 25) is sqrt(25) end

  2. :: ->
    examples: mystery(triangle(70, "solid", "green")) is triangle(140, "solid", "green") mystery(triangle(100, "solid", "green")) is triangle(200, "solid", "green") end

  3. :: ->
    examples: mystery("red") is triangle(140, "solid", "red") mystery("blue", "circle") is circle(140, "solid", "blue") end

  4. :: ->
    examples: mystery("circle", 4) is pi * sqr(4) mystery("square", 5) is sqr(5) end

  5. :: ->
    examples: mystery("dog") is 3 mystery("cat") is "kitten" end

  6. :: ->
    examples: mystery("dog") is 3 mystery("kitten") is 6 end

  7. :: ->
    examples: mystery(4, 5, "big") is scale(2, rectangle(4, 5, "solid", "blue")) mystery(10, "small", 4) is scale(0.5, rectangle(10, 4, "solid", "blue")) end

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, and 1738598). CCbadge Bootstrap:Integrated Oklahoma by Jen Poole is licensed under a Creative Commons 4.0 Unported License. Based on a work at www.BootstrapWorld.org. Permissions beyond the scope of this license may be available by contacting schanzer@BootstrapWorld.org.