The table t below represents four animals from the shelter:

name sex age fixed species pounds

"Toggle"

"female"

12

true

"dog"

48

"Fritz"

"male"

4

false

"dog"

92

"Nori"

"female"

6

true

"dog"

35.3

"Sunflower"

"female"

2

false

"cat"

51.6

Convert each Circle of Evaluation below into Pyret code. What do you think the resulting table will be?
The first one has been done for you.

Circle of Evaluation Pyret code

1

(sort (filter t is-dog) "name" false)

sort​(​filter​(​t, is-dog​), "name", false​)

2

(sort t "name" false)

3

(build-column (filter t is-cat) "large" is-big)

4

(filter (sort t "pounds" true) is-dog)

5

(filter (build-column t "large" is-big) is-cat)

Define the functions specified below by filling in the blanks. The first one has been done for you.

6

A function is-cat, which returns true if the animal is a cat.

fun is-cat(r): r["species"] == "cat" end

7

A function is-dog, which returns true if the animal is a dog.

fun is-dog(r): end

8

A function is-big, which returns true if an animal weighs more than 50 pounds.

fun is-big(r): end

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927). CCbadge 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.