Referenced from lesson Restating the Problem
Directions: Getting a gym membership costs $150, and then there’s a $45/month fee after that. Write a function globo-gym
that takes in a number of months and produces the cost of a membership for that many months.
Contract and Purpose Statement |
Every contract has three parts…
# _________::______->______
# __________________________________________________________________________________________
Examples |
Write some examples, then circle and label what changes…
examples:
___________ (_)is ______________
___________ (_)is ______________
end
Definition |
Write the definition, giving variable names to all your input values…
fun _________(______):
_____________________
end
Directions: The cost of a ride is a starting price of $2.50, plus $1.50/mile. Write a function rideshare
, that takes in a number of miles and produces the cost of that right.
Contract and Purpose Statement |
Every contract has three parts…
# _________::______->______
# ______________________________________________________________________________
Examples |
Write some examples, then circle and label what changes…
examples:
___________ (_)is _______________
___________ (_)is _______________
end
Definition |
Write the definition, giving variable names to all your input values…
fun _________(_____):
_____________________
end
These materials were developed partly through support of the National Science Foundation,
(awards 1042210, 1535276, 1648684, and 1738598).
Bootstrap:Algebra by Emmanuel Schanzer, Jen Poole, Ed Campos Jr, Flannery Denny, and Dorai Sitaram
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.