Page 206 - Learn To Program With Scratch
P. 206

9.  Although the procedure in problem 8 checks all integers up to one-half
                             the input value, it is sufficient to set the upper limit to the square root
                             of the input. Make this change to the procedure and test it to see if it
                             still gives the same answers.
                         10.  The sequence of numbers
                                              0, 1, 1, 2, 3, 5, 8, 13, 21, 34 ....

                             is called a Fibonacci series. The first two numbers in the series are 0
                             and 1. Each subsequent number is then calculated as the sum of the
                             previous two. Write a program that calculates the nth term of the
                             Fibonacci series, where n is entered by the user.
                         11.  Consider the following program and its generated output. Re-create
                             the program and run it to see how it works. Change the turn angle
                             (from 10°) and the argument in the recursive call (to side + 1 or
                             side + 3, and so on) to discover what else you can create.




























           184   Chapter 7
                                           www.it-ebooks.info
   201   202   203   204   205   206   207   208   209   210   211