Coding an App: Perfect Squares and Square Roots

In this activity we will build an app that 1) generates the first 10 perfect squares and 2) prompts the user to determine the square root of one of them, chosen at random.

To begin, create a variable. I have named mine counter. Set counter to 1 to begin and setup the loop structure as seen above. Your loop will loop 10 times, multiply counter by itself each time, and then increment counter by 1.

Essentially it looks like this when it runs:

1 * 1

2 * 2

3 * 3

etc.

Next, chose a random number between 1 and 10. This will refer to the row number of our list.

Prompt the user to input the square root of the randomly chosen perfect square, set up the math structure and give it a try!

Future-ready students need to be creative. They need to know how to communicate their ideas and how to collaborate as problem solvers. To master these and other twenty-first-century requirements, they will need to be critical thinkers.

You don’t have to be a “computer geek” to empower your students with these essential skills. Code Breaker equips you to use computational thinking and coding in your classroom – regardless of your computer skill level – to increase creativity, remix assessment, and develop a class of coder ninjas!