Document Type


Publication Date


Publication Title

CSTA Nifty Assignments in CSTA 2022 Annual Conference

Publisher Name

Computer Science Teachers Association

Publisher Location

Chicago, IL


This assignment combines programming and data analysis to determine good combinations of side lengths that approximately satisfy the Pythagorean Theorem for right triangles. This can be a standalone exercise using a wide variety of programming languages, but the results are useful for determining good ways to assemble LEGO pieces in robot construction, so the exercise can serve to integrate three different units of the Exploring Computer Science high school curriculum: "Programming", "Computing and Data Analysis", and "Robotics". Sample assignment handouts are provided for both Scratch and Java programmers. Ideas for several variants of the assignment are also provided.


Author Posting. © CSTA, 2022. This is the author's version of the work. It is posted here by permission of the CSTA for personal use, not for redistribution. The definitive version was published in CSTA Nifty Assignments from the CSTA 2022 Annual Conference, July 2022.

Creative Commons License

Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License.

Greenberg2022-slides.pptx (999 kB)
Conference presentation slides