Bonus Project Creating a Formula Using Variables. In this project we are going to create a formula to calculate the missing angle of a triangle using the formula: 180 – (Angle A + Angle B). Step #1. Like in most projects we are going to start with the “when flag is clicked” block under “Controls” ______________________________________________________________________________ Step #2. Under “Sensing” drag in two “ask” blocks. In one type, “How many degrees in angle A?” In the one below type in, “How many degrees in angle B?” Step #3. We are now going to create variables. Click on the “Data” tab and click on “Make a Variable”. We are going to make three variables. Name them “Angle A”, “Angle B, and “Mystery Angle”. ______________________________________________________________________________ Step #4. In the “Data” tab grab two “set” blocks and place them under the two blue questions. Use the pull down arrow to make the top “set” block associate with variable angle A and the second with angle B. Now go to the “Sensing” tab and drag an answer block so that your script looks like the picture below. You may not have known it at the time but we have done something really cool. We asked a question and allowed the user to fill in the variables. Step #5 Drag in a “set” block after the “set Angle B” block. Make sure “Mystery Angle” is selected. Go to the “Operators” tab and drag in the “minus” block like in the picture below. Type 180 into the blank field on the left. In “Operators” place a “+” tab to the field to the right. Then go to the “Data” tab and drag in the “Angle A” and “Angle B” variables. When a block is placed inside another block it is referred to as nesting. Think of nesting dolls. This is a powerful concept that allows for complicated programs. Way to go computer prodigy! ______________________________________________________________________________ Step #5. Your program should work at this point. Click on the green flag to test your program out. If it works… congratulations! If not you have the opportunity to go back and see what went wrong. A learning opportunity! Bonus *Make the cat say “The mystery angle is (however many) degrees.” -Hint you will need the “say” block under “Looks”, the “join” block under “Operators”, and the “Mystery Angle” under “Data”. You can do this creating one nested block. *Create a new formula. You can go with area, perimeter, volume, MPG for a Ferrari, or other. *Have the computer pick random numbers for your formula using “pick random number” under “Operators”. *Create a game using random numbers where the student has to guess the mystery numbers based on the random angles generated. If you are feeling ambitious you can have the cat respond with “wrong” or “right” using an “if” block.