Referenced from lesson Histograms
For the word problems below, assume you have animalA
and
animalB
defined in your code.
Directions: Define a function called kilos,
which consumes a Row of the animals table and divides the pounds column by 2.2 to compute the animal’s weight in kilograms.
Contract and Purpose Statement |
Every contract has three parts…
# _____::(r :: Row)->______
# ______________________________________________________________
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: Define a function called smart-dot,
which consumes a Row of the animals table and computes the image of a solid red circle using the animal’s pounds
as the radius.
Contract and Purpose Statement |
Every contract has three parts…
# smart-dot::____________________->Image
# Consumes an animal, and computes a solid red circle using the weight in pounds as the radius
Examples |
Write some examples, then circle and label what changes…
examples:
__smart-dot ("animalA")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:Data Science by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.