Page 124 - KEC Khaitan C3 Flipbook
P. 124

CHAPTER
                  INTERACTIVITY AND LOGIC                                                                C4

















                     LEARNING OUTCOMES


                    The student will be able to:
                        use Conditional Blocks to create decision-making scripts.
                        understand Variables and their role in storing data.
                        apply Sensing Blocks for user interactions.



                  In the previous chapter, you learned about the Paint Editor in Scratch and how to
                  animate a sprite using multiple costumes.

                  In this chapter, you will explore Conditional blocks, Variables and Sensing blocks,

                  to make your project more interactive.



                            CONDITIONAL BLOCKS


                  Many  times, you  have to  do  a task  which is  dependent  on some  condition.  For
                  example, you have to make mango shake. There are two conditions:

                  a.  Go to the refrigerator and check if there are mangoes. If mangoes are there, then
                     you will make mango shake.

                  b. If the mangoes are not there, you will make cold coffee.

                    Here the condition is the availability of mango.
                    You can also write this in two ways:


                   1. if                                             2. if
                         mango is available                                   mango is available
                       then                                               then

                         make the mango shake                                 make the mango shake

                                                                           else
                                                                               make cold coffee




                  122   Premium Edition-III
   119   120   121   122   123   124   125   126   127   128   129