Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 138 - 2505_CoreGPT(Podar)_Flipbook_C5
P. 138

    QUESTIONING AND ANSWERING IN SCRATCH

                      In Scratch, you can use the ask [question] and wait block to make the sprite ask

                      a question. The sprite will then wait for the user to answer and you can use the
                      answer block to check the user’s response.

                      To create a program of question and answer, follow the given steps:
                      Step 1  Click on Variables block category.

                      Step 2  Click on  Make a variable  button.  Type  a
                                variable name in the Variable name? text box.

                      Step 3  Click  on the radio button of either of the
                                options. Click on  For all sprites if you want
                                this variable to appear for all the sprites.

                      Step 4  Click OK button.

                      The variable appears in the list of Variables blocks. Observe that the variable name
                      Fruit appears in all the blocks. Now, create the following script:

                      The sprite will ask you to type your favourite fruit. When you press the Enter key,
                      the name of the fruit appears in the speech bubble of the sprite. The name of the

                      fruit then appears in the answer as well as in the variable name on the stage.

                    136     Premium Edition-V

| 133 134 135 136 137 138 139 140 141 142 143 |