Booleans and Numbers
In the Boolean Starter File, open the Transformer called filter-is-???
, pictured below. For each prompt below, you will select "Edit" in the Transformer, and then enter the specified Boolean expression. (Relevant boxes are highlighted in red in the image on the right.)
1 Click Edit. Change
2 What would be a good name for a Transformer with the expression
3 What would be a good Purpose Statement for a Transformer with the expression |
4 With your partner, test out each of the Booleans listed below, using Pounds
32
as the Transformer’s expression.
-
What happens if you put < in the blank?
-
What happens if you put > in the blank?
-
What happens if you put <= in the blank?
-
What happens if you put >= in the blank?
-
What happens if you put != in the blank?
Booleans and Strings
5 Click Edit. This time, type Name>"Maple"
in the expression box. What happened?
6 Predict what will happen if you edit the expression so that it says Name<="Maple"
(then try it!).
7 With your partner, test out each of the Booleans listed below, using Name
Maple
as the expression.
-
What happens if you put < in the blank?
-
What happens if you put
=
in the blank? -
What happens if you put
>=
in the blank? -
What happens if you put
<=
in the blank? -
What happens if you put
!=
in the blank?
8 Edit the Transformer’s expression so that it says: beginsWith(Name, "Sn")
. What happened?
9 Now try this expression: beginsWith(Name, "sn")
. Did you get the result you expected?
★ Go back to Booleans and Filters (1) and use a different color pen to correct any questions (4-15) that you got wrong.
These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927).
Bootstrap 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.