Referenced from lesson Method Chaining (Spring, 2021)
You have the following functions defined below (read them carefully!):
fun isfixed(r): r["fixed"] end
fun isyoung(r): r["age"] < 4 end
fun nametag(r): text(r["name"], 20, "red") end
fun isfemale(r): r["sex"] == "female" end
fun kilograms(r): r["pounds"] / 2.2 end
fun isheavy(r): r["kilos"] > 25 end
fun iscat(r): r["species"] == "cat" end
fun isdog(r): r["species"] == "dog" end
Assume that animalstable
is defined, and represents all the animals at the shelter. Solve the word problems below using these functions with filter
, buildcolumn
, and orderby
.
1 
Create a table of all female cats. 

2 
Create a table of all young, fixed animals. 

3 
Create a table of all female dogs, converting their weight to kilograms. 

4 
Create a table of all heavy dogs. 

5 
Create a table of all young, fixed dogs, sorted from lightest to heaviest. 

6 
Create a table of all fixed, young animals, with an extra column showing images of their nametags. 

7 
Create a table of fixed, female cats, with a column showing images of their nametages, sorted heaviesttolightest by their weight in kilograms. 
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.