Week 6 Exercises

This week the topic was decision making… using the if/then and if/then/else blocks. Decision statements are a required skill in traditional programming and are just as important in Scratch. I chose to do problems 6 and 10 from chapter 6.

Problem 6 asks for a program where the user is to enter three numbers and the program displays the largest of the three numbers. To customize this program a bit I added a number line graphic for the stage, a number routine and rather than displaying just the largest number, I sort, order and display the numbers in order smallest to largest.

In the first iteration of this project I didn’t consider the possibility of the same number being entered so I had to add an = test to the conditions to account for that possibility.

Click the image to go to the program.

smallest2largest

 

Problem 10 asks for a program that determines if the measures of three sides of a triangle will yield a right triangle using the the relationship stated in the Pythagorean Theorem…  c² = a² + b². After completing the minimum requirements I added a user input routine, a right triangle graphic and yes/no indicator lamps that light based on whether or not the side measures will yield a right triangle.

rt_triangle

 

I enjoyed working with both of the problems this week. Both problems were challenging to build and fun to use.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s