My students are working on “functions with return values” (lesson 16) now. I really like the “constrain” function but it is pretty tricky for students. I am trying to think of other whole-class practice we could do together. Right now I am thinking of doing a function called canRide which returns true if a kid meets the parameters for a hypothetical amusement park ride (something like, if the age is greater than 8 and height is greater than 4ft, return true, else return false).

Then use they canRide inside an if else statement to show a picture of a happy kid if they can ride the ride, else, show a picture of a sad kid. I know I will have some students who will push back on if they really need a return and why they wouldn’t just make the pictures show up in the canRide function… but it is at least something to start with.

I am wondering what other ideas people have for practice with returns!

Thanks!

KT