Skip to main content

Chicken-Rabbit Problem

Challenge: A total of 9 chickens and rabbits are caged together on a farm. The farmers know that there are 28 legs inside the cage. The object of the activity is to create an algorithm to help the farmers calculate the number of chickens and rabbits respectively. Code the VR Robot to drive to the chicken number buttons (orange outlined) and the rabbit number buttons (pink outlined) at the bottom of the Art Canvas + playground, fill the calculated chicken number button with orange, and fill the calculated rabbit number button with pink.

  • Choose and Download the Chicken-Rabbit Problem worksheet as a PNG file from this Google slideshow.
  • Select the Art Canvas+ Playground and upload the Chicken-Rabbit Problem worksheet.
  • Design an algorithm to calculate the number of chickens and the number of rabbits.
    • Create variables to store the number of chickens and rabbits respectively, and set the initial values to 0.
    • Increment the number of chickens by 1, create a mathematical expression to calculate the number of rabbits, and then check if the total number of legs is 28. Repeat this process for a set number of times until the correct number of chickens and the correct number of rabbits are found. 
    • Use the [print] block to print the calculated chicken number and rabbit number to the Print Console.
  • Using the VR Pen, drive the VR Robot to fill the calculated chicken number button with orange and fill the calculated rabbit number button with pink.

Helpful Hints

  • The distance across one number button at the bottom is 200mm.