KnowledgeBoat Logo
OPEN IN APP

Chapter 8

Scratch Programming II

Class 10 - Sumita Arora CBSE Computer Code 165



Objective Type Questions

Question 1

Which of the following types, does repeat block belong to?

  1. Conditional
  2. Iteration
  3. Data
  4. Operator

Answer

Iteration

Reason — Repeat block belongs to iteration category.

Question 2

Which of the following types, does if...else block belong to?

  1. Conditional
  2. Iteration
  3. Data
  4. Operator

Answer

Conditional

Reason — if...else block belongs to conditional category.

Question 3

Which of the following command blocks enables you to control a sprite?

  1. Point in direction
  2. Wait_secs
  3. When_key is pressed
  4. Pen down

Answer

When_key is pressed

Reason — 'When_key is pressed' block enables us to control a sprite.

Question 4

Which of the following are conditional blocks?

  1. Repeat
  2. if
  3. Forever
  4. if-else

Answer

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.

Question 5

A Scratch script/program begins with

  1. An ask block
  2. A Say block
  3. An event block
  4. A control block

Answer

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".

Theoretical Questions

Question 1

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.

Answer

(a) False.
Reason — In Scratch, the Ask block stores the user's response in "answer" variable.

(b) True.
Reason — When the pen is down, the sprite draws as it moves on the stage.

(c) True.
Reason — Scratch provides a broadcast block from Events category that will send the specified message to all the sprites.

(d) True.
Reason — A variable is a placeholder that can store a value as long as the script runs.

(e) False.
Reason — The Ask block stores the user's response in a default variable named 'answer'. It may not be created by the user beforehand.

Question 2

What limits define the X, Y coordinate system of Scratch ?

Answer

The value of X coordinate ranges from -240 to 240 and the value of Y coordinate ranges from -180 to 180.

Question 3

Which block will you use to place a sprite at a specific XY position on screen ?

Answer

The go to x:__ y:__ block is used to place a sprite at a specific XY position on screen.

Question 4

What are events in Scratch ? How are these useful ?

Answer

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.

Question 5

Which block(s) will you use to play sounds in a script ?

Answer

We will use the following blocks to play sounds in a script :

  1. play sound ___
  2. play sound ___ until done
  3. play drum ___ for ___ beats
  4. play note ___ for ___ beats

Question 6

Which predefined variables of sound can you use to control the loudness and play-speed of sound, respectively ?

Answer

We can use the volume and tempo to control the loudness and play-speed of sound, respectively.

Question 7

What all can you do through Data category of blocks ?

Answer

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.

Question 8

What is the difference between repeat and repeat until blocks ?

Answer

Repeat block iterates a specified number of times whereas repeat until block repeats as long as the given condition is false.

Question 9

What is the difference between repeat and forever blocks ?

Answer

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.

Question 10

What is the difference between if and if-else blocks ?

Answer

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.

Question 11

What is the difference between say and ask blocks ?

Answer

The differences between say and ask blocks are:

  1. 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.
  2. 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.
  3. Say block doesn't prompt the user for any response whereas ask block provides an input box where the user can type his response.
  4. Say block is available under looks category whereas ask block is available under sensing category.

Question 12

To send a message to all the sprites in the program, which block will you use ?

Answer

We will use broadcast <message> block from Events category to send a message to all the sprites in the program.

Question 13

To respond to a received message, which block can be used by a sprite ?

Answer

We will use When I receive <message> block from Events category to respond to a received message.

Question 14

All the three blocks given below run infinitely.

Make changes in these so that these play the Meow sound for exactly five times.

(a)

Make changes in these so that these play the Meow sound for exactly five times. Scratch Programming II, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 10.

(b)

Make changes in these so that these play the Meow sound for exactly five times. Scratch Programming II, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 10.

(c)

Make changes in these so that these play the Meow sound for exactly five times. Scratch Programming II, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 10.

Answer

The changed blocks for playing the Meow sound for exactly five times are given below:

(a)

Make changes in these so that these play the Meow sound for exactly five times. Scratch Programming II, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 10.

(b)

Make changes in these so that these play the Meow sound for exactly five times. Scratch Programming II, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 10.

(c)

Make changes in these so that these play the Meow sound for exactly five times. Scratch Programming II, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 10.

Question 15

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

Answer

(i) The Ask block under Sensing category

(ii) Make a variable block under Data category

Application Oriented Questions

Question 1

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.

Answer

(a) The concepts/features of Scratch used in this game are as follows:

  1. Sprites — The moving images of multiple things/sprites are used to represent the different items.
  2. Costumes — Each sprite likely has multiple costumes to show different visual representations.
  3. Click events — The player interacts with the game by clicking on the correct sprite.
  4. Sounds — The game plays a clap sound when the correct sprite is clicked.
  5. Keyboard events — The game detects when the space bar is pressed to move to the next item.
  6. Conditional blocks — There are conditional checks to determine if the correct sprite is clicked, triggering the response with the ball sprite and clap sound.
  7. Iteration blocks — Iteration blocks are used to make the game run continuously.
  8. 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.

Lab Exercise

Question 1(a)

Write Scratch programs to draw these shapes :

Write Scratch programs to draw these shapes. Scratch Programming II, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 10.

Answer

Scratch program to draw hexagon. Scratch Programming II, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 10.

Question 1(b)

Write Scratch programs to draw these shapes :

Write Scratch programs to draw these shapes. Scratch Programming II, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 10.

Answer

Scratch program to draw three hexagon. Scratch Programming II, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 10.

Question 2

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.

Answer

Create a Guessing game where your sprite generates a number (Host Number) in the range 10 to 99. Scratch Programming II, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 10.

Question 3

Write a Scratch program to draw this

Write a Scratch program to draw a traffic signal. Scratch Programming II, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 10.

Answer

Scratch program to draw a traffic signal. Scratch Programming II, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 10.

Question 4

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.

Answer

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. Scratch Programming II, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 10.
PrevNext