Objective Type Questions
Which of the following types, does repeat block belong to?
Reason — Repeat block belongs to iteration category.
Which of the following types, does if...else block belong to?
Reason — if...else block belongs to conditional category.
Which of the following command blocks enables you to control a sprite?
- Point in direction
- When_key is pressed
- Pen down
When_key is pressed
Reason — 'When_key is pressed' block enables us to control a sprite.
Which of the following are conditional blocks?
if and if-else
Reason — if and if-else blocks perform a certain function if a particular condition is true or false. Hence, they are conditional blocks.
A Scratch script/program begins with
- An ask block
- A Say block
- An event block
- A control block
An event block
Reason — In Scratch, the event blocks are used to start the execution of a script when a specific event occurs. Common event blocks include, "When Green Flag Clicked", "When Key Pressed", "When Sprite Clicked".
True or False.
(a) In Scratch, the Ask block stores the user's response in "question" variable.
(b) In Scratch, movement of a sprite draws on stage only if pen is down.
(c) Multiple sprites can receive a message.
(d) A variable can be thought of as a container or placeholder in memory holding different values over time.
(e) An answer variable must be created before using Ask block.
Reason — In Scratch, the Ask block stores the user's response in "answer" variable.
Reason — When the pen is down, the sprite draws as it moves on the stage.
Reason — Scratch provides a broadcast block from Events category that will send the specified message to all the sprites.
Reason — A variable is a placeholder that can store a value as long as the script runs.
Reason — The Ask block stores the user's response in a default variable named 'answer'. It may not be created by the user beforehand.
What limits define the X, Y coordinate system of Scratch ?
The value of X coordinate ranges from -240 to 240 and the value of Y coordinate ranges from -180 to 180.
Which block will you use to place a sprite at a specific XY position on screen ?
The go to x:__ y:__ block is used to place a sprite at a specific XY position on screen.
What are events in Scratch ? How are these useful ?
An event refers to occurrence of some action recognized by computer. For example, when a key is pressed on the keyboard or when we click a mouse button.
Using events blocks, we can create programs defining actions to be performed in case a specific event occurs. For example, with the help of events, we can rotate our sprite by 15° when the user presses a space key.
Which block(s) will you use to play sounds in a script ?
We will use the following blocks to play sounds in a script :
- play sound ___
- play sound ___ until done
- play drum ___ for ___ beats
- play note ___ for ___ beats
Which predefined variables of sound can you use to control the loudness and play-speed of sound, respectively ?
We can use the volume and tempo to control the loudness and play-speed of sound, respectively.
What all can you do through Data category of blocks ?
Data blocks let us create and manipulate data in our animations and games. We can create two types of data: variables and lists. These can be used with sprites and with the stage.
When we specify the name of a variable, we can also specify if the variable is a local variable or a global variable. Once the variable is created, it is available through the Data block and the commands used to manipulate the variable are also available in the Data block.
What is the difference between repeat and repeat until blocks ?
Repeat block iterates a specified number of times whereas repeat until block repeats as long as the given condition is false.
What is the difference between repeat and forever blocks ?
Repeat block is a finite iteration block i.e., it iterates a specified number of times whereas forever block is an infinite iteration block i.e., it keeps repeating the commands inside it over and over again.
What is the difference between if and if-else blocks ?
The if block is used when we have to take action depending on a certain condition being true whereas the if-else block is used when we have to take different courses of action depending upon whether the condition is true or false.
What is the difference between say and ask blocks ?
The differences between say and ask blocks are:
- Say block is used to represent speech by sprites whereas ask block is used to prompt something to user asking for a value or response.
- Say block displays a specific speech block in the speech bubble which appears on the screen for a specified amount of time whereas ask block provides a place for the message to be displayed and waits for the response.
- Say block doesn't prompt the user for any response whereas ask block provides an input box where the user can type his response.
- Say block is available under looks category whereas ask block is available under sensing category.
To send a message to all the sprites in the program, which block will you use ?
We will use
broadcast <message> block from Events category to send a message to all the sprites in the program.
To respond to a received message, which block can be used by a sprite ?
We will use
When I receive <message> block from Events category to respond to a received message.
All the three blocks given below run infinitely.
Make changes in these so that these play the Meow sound for exactly five times.
The changed blocks for playing the Meow sound for exactly five times are given below:
Name the tab and category of blocks that should be selected to do the following :
(i) Ask the user's name
(ii) Add a variable to store points of the game
(i) The Ask block under Sensing category
(ii) Make a variable block under Data category
Application Oriented Questions
Navdha is playing a game created by her teacher using Scratch. The game works like this :
An item/thing name is shown on screen and then the screen shows moving images of multiple things/sprites. The player has to click on correct image/sprite as per displayed name. If the player clicks on correct sprite/image, a ball sprite in the right corner starts jumping and clap sound also plays. If the player wants to move to next thing/item, the player can press a space bar.
(a) Identify the concepts/features of Scratch used in this game.
(b) Which concept/feature is used to move to next item if space bar is clicked ?
(c) Which concept/feature is used to tell ball sprite that correct image/sprite has been clicked.
(a) The concepts/features of Scratch used in this game are as follows:
- Sprites — The moving images of multiple things/sprites are used to represent the different items.
- Costumes — Each sprite likely has multiple costumes to show different visual representations.
- Click events — The player interacts with the game by clicking on the correct sprite.
- Sounds — The game plays a clap sound when the correct sprite is clicked.
- Keyboard events — The game detects when the space bar is pressed to move to the next item.
- Conditional blocks — There are conditional checks to determine if the correct sprite is clicked, triggering the response with the ball sprite and clap sound.
- Iteration blocks — Iteration blocks are used to make the game run continuously.
- Passing messages between sprites — The game uses the broadcast block to send message to ball sprite telling that correct sprite has been clicked.
(b) The Events feature is used to move to next item if space bar is clicked. The programmer uses the command
when space key pressed so that the game listens for the space bar key press event and uses this event to advance to the next item.
(c) The broadcast block from events category is used to tell ball sprite that correct image/sprite has been clicked.
Write Scratch programs to draw these shapes :
Write Scratch programs to draw these shapes :
Create a Guessing game where your sprite generates a number (Host Number) in the range 10 to 99 (*Use Random number generator for this).
User is then asked to 'Guess this number' (userGuess) and given 5 chances to do this (*5 times loop)
If the user's number (i.e., UserGuess) is same as HostNumber, then your program should display "You Win" and plays a drum sound. If user is not able to guess the number then
- for every unsuccessful guess, display message "Try again" with a drum sound play.
- After 5 unsuccessful guesses, display, "Sorry buddy, you lose. My number was <Host Number>", with a drum sound.
Write a Scratch program to draw this
Write an interactive program in which the sprite is crazily drawing on stage forever. But if the user presses a space bar, the pen size and pen colour change along with a sound play.