Page 1 :
7.Programming in Scratch, Exercises, 1. Fill in the blanks., a. The block send a broadcast/message through the whole scratch program., b. is used to pauses script., c. block will stop all the running code., d. block help to point a sprite a specified number of degrees, e. has two options for condition: loudness and timer, 2. Define the function of the following blocks., a., A code placed underneath this block is triggered when the specified key is pressed. These are mostly keys on the keyboard, such as letters (A–Z), numeric keys (0–9), Spacebar or the arrow keys., b., When this block is used, the code is activated as soon as the background changes to the specified backdrop., c., The blocks used within this block are run repeatedly for a specified number of times, before moving to the next code block., d., When this block is used, If the condition is true, the script inside the block will run first, and then the script outside the block will continue. But, if the condition is false, the code inside the else block will run before moving to the script outside the block., e., This block is used to stop run ning the code. It is mostly used to stop forever block but can also be used outside it to end the project. It has 3 options that can be used to either stop all scripts, one particular script or the other scripts running in that sprite., f., It makes the sprite glide to the end destination in the specified number of seconds, giving an animated effect., 3. State whether the statements are true or false., a. block moves the sprite towards the other sprite in 5 seconds., False, b. block keeps running until the stop button is clicked., True, c. is a motion block., True, d. block will run the code infinite times., False, e. block has to be used with the broadcast block., True, 4. Answer the following questions., a. What are the different event blocks? Explain any four., There are 8 Events blocks. When the specific event occurs, it would trigger a line of script or code. The Events blocks are mostly used to make the program run on its own., When this sprite clicked block: This Events block is used when we want some code to activate once a particular sprite, that contain this code, is clicked. This is active only when that particular sprite is visible (shown) on stage., When backdrop switch to backdrop1 block: When this block is used, the code is activated as soon as the background changes to the specified backdrop., When loudness > ( ) block: This block starts the script below it, when a value (loudness/timer) is greater than the specified numerical input., (iv) When I receive message1 block: This block receives a broadcast, and accordingly, runs the required script. This block is used along with broadcast message1 block., b. Explain the blocks with an example., Ans-The broadcast message1 -block sends a broadcast/message throughout the whole Scratch program, whereas when I receive message1 block receives a broadcast, and accordingly, runs the required script. Both these blocks are always used along with each other ,broadcast message1 block is usually used to start a new event altogether. Any sprite or script which receives the specified broadcast message will invoke the block. In the given example, the sprite will keep changing the costume whenever it is clicked, that is, once it receives the ‘message1’., c. What are control blocks?, Ans-Control blocks are important components in Scratch as they make the code very efficient. As the name suggests, these blocks let us control the other blocks in our code., d. Discuss any four motion blocks., Ans-The four motion blocks are as below:, move ( ) steps block: This block moves the sprite in forward direction for the specified number of steps., go to random position block: This block directly takes the sprites to the specified position. It has 3 drop-down options, random position, mouse pointer and sprite., glide ( ) secs to random position block: This block is similar to the go to random position block, except that it makes the sprite glide to the end destination in the specified number of seconds, giving an animated effect. It has the same 3 dropdown options as the go to random position block., (iv) turn ( ) degrees blocks: These Motion blocks enable the sprite to turn a specified amount of degrees anti-clockwise or clockwise. This changes the direction the sprite is facing., 5. what will happen when the following codes are run?, a. The sprite will keep moving forward 10 steps until it touches the edge of the stage., b. This code will move the sprit 10 steps forward when the space key is pressed., c. This code will turn the sprite 15 degrees clockwise for 10 times and each time after ever turn the sprite will wait for 1 second. Once the loop is over it will execute the next code. The sprite will say “Hello!” for 2 seconds., d. This code will be executed when the sprite is clicked and it will keep changing costume forever until the project is stopped., e. This code will make the sprite appear on the screen when backdrop switches to Underwater 2 backdrop.