KnowledgeBoat Logo
OPEN IN APP

Chapter 12

Scratch Programming I

Class 9 - Sumita Arora CBSE Computer Code 165



Objective Type Questions

Question 1

In which block category do you find blocks to start your script ?

  1. Operators
  2. Events
  3. Data
  4. Motion

Answer

Events

Reason — Hat blocks are used to start a script and are usually found in Events category of blocks.

Question 2

In which category do you find block to change the direction of sprite ?

  1. Operators
  2. Events
  3. Data
  4. Motion

Answer

Motion

Reason — Motion category of blocks contains blocks for the movement of a sprite.

Question 3

The background on which your script runs or your sprite moves, is called ............... .

  1. Sprite
  2. Backdrop
  3. Background
  4. The stage

Answer

The stage

Reason — The background on which your script runs or your sprite moves, is called the stage.

Question 4

The background imagery of the stage is known as ............... .

  1. Sprite
  2. Backdrop
  3. Background
  4. The stage

Answer

Backdrop

Reason — The background imagery of the stage is known as backdrop.

Question 5

Which of the following command will leave impression of sprite on the stage ?

  1. Pen down
  2. Pen up
  3. Stamp
  4. Down

Answer

Stamp

Reason — Stamp command leaves an impression of sprite on the stage.

Question 6

Which of the following command will prevent your sprite to move off the stage ?

  1. go to x .......... y ..........
  2. set x to ..........
  3. If On edge, bounce
  4. change x by ..........

Answer

If On edge, bounce

Reason — If On edge, bounce command checks to see if the sprite is on the edge of the stage. If the sprite is on the edge, then it flips the sprite around so that it faces the other way. Thus, the sprite cannot get off the stage.

Question 7

Which of the following will take action based on an action only once ?

  1. repeat until <condition>
  2. if <condition> then
  3. repeat ..........
  4. none of these

Answer

if <condition> then

Reason — The if <condition> then block takes an action depending on a certain condition.

Question 8

From the given table of letters, find words / terms related to Scratch (can be left-to-right, right-to-left, top-to-bottom, diagonally upwards, downwards etc.)

From the given table of letters, find words / terms related to Scratch (can be left-to-right, right-to-left, top-to-bottom, diagonally upwards, downwards etc.) Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.

Answer

The words are as follows:

  1. CONTROL
  2. MOVE
  3. PROGRAM
  4. SCRATCH
  5. SCRIPT
  6. SPRITE
  7. STAGE
From the given table of letters, find words / terms related to Scratch (can be left-to-right, right-to-left, top-to-bottom, diagonally upwards, downwards etc.) Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.

Question 9

Look at the section of code opposite that controls a sprite.

Look at the section of code that controls a sprite. Write down what you think the user will see when the green flag is clicked. Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.

Write down what you think the user will see when the green flag is clicked.

Answer

When the green flag is clicked, the sprite is at the same position.

Explanation

The sprite moved forward 10 steps and then moved backwards the same number of steps. Thus the user will see the sprite at the same position after the green flag is clicked and the script has run.

Question 10

Why did you think the sprite behaved this way ? (refer to above question)

Answer

The sprite behaved this way because the sprite moved forward 10 steps and then moved backwards the same number of steps.

Question 11

A position on the stage is also called ................ .

  1. pos
  2. part
  3. pixel
  4. dot ?

Answer

pixel

Reason — A position on the stage is also called pixel.

Question 12

Name the block to replay an action (or a set of actions) for a specific number of times

  1. repeat block
  2. if block
  3. forever block
  4. repeat until block

Answer

repeat block

Reason — The repeat block is used to repeat a code a specific number of times.

Question 13

Name the block to keep repeating a set of action endlessly

  1. repeat block
  2. if block
  3. forever block
  4. repeat until block

Answer

forever block

Reason — The forever block is used to keep repeating a set of action endlessly.

Question 14

Name the block used to perform an action or a set of actions only if some condition is true or another action has happened first

  1. repeat
  2. if
  3. check
  4. wait

Answer

if

Reason — The if block is used to perform an action or a set of actions only if some condition is true or another action has happened first.

Question 15

The location of the sprite on the stage can be controlled via

  1. the paint editor
  2. control block
  3. the "x" and "y" coordinates
  4. looks block

Answer

the "x" and "y" coordinates

Reason — The location of the sprite on the stage can be controlled via the "x" and "y" coordinates.

Question 16

Match the following statements

(i) Group of commands that together make a sprite behave in a certain way(a) Motion Blocks
(ii) Blocks used for drawing on the stage.(b) Stage
(iii) Background on which animations and other actions take place.(c) Script
(iv) Category of blocks that mostly begin the working of script.(d) Hat blocks
(v) Category of blocks that let you specify the direction for sprite.(e) Pen blocks

Answer

(i) Group of commands that together make a sprite behave in a certain way(c) Script
(ii) Blocks used for drawing on the stage.(e) Pen blocks
(iii) Background on which animations and other actions take place.(b) Stage
(iv) Category of blocks that mostly begin the working of script.(d) Hat blocks
(v) Category of blocks that let you specify the direction for sprite.(a) Motion Blocks

Question 17

The following block is an example of a(n) ................. .

The following block is an example of? Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.
  1. Operator
  2. Loop
  3. Algorithm
  4. Variable

Answer

Loop

Reason — The following block is an example of a loop.

Theoretical Questions

Question 1

What is program ? What is programming ?

Answer

Program refers to a set of instructions given to computer to do something. For example, to add two numbers.

Programming refers to the act of writing programs.

Question 2

What do you understand by these terms ?

(a) Stage

(b) Sprite

(c) Blocks Palette

Answer

(a) Stage — Stage is the background on which animations and other actions take place.

(b) Sprite — A sprite is a graphic image, usually animated, that a user can interact with and that moves around.

(c) Blocks Palette — Blocks Palette is the area that contains all possible types of commands. It groups the commands in various categories such as Motion, Looks, Sound, Pen, Events etc.

Question 3

What does a script or a program do in Scratch ?

Answer

In Scratch, a script is a sequence of visually stacked blocks that control a sprite's actions. These blocks, representing commands like movement and sound, are dragged and connected to create instructions. When the program runs, the sprite follows the scripted actions. We can control the movement, appearance, sound, and interactions of sprites through these scripts.

Question 4

What are the values for four main directions in Scratch ?

Answer

The values for four main directions in Scratch are as follows:

  1. Up — 0°
  2. Right — 90°
  3. Down — 180°
  4. Left — -90°

Question 5

State true or false.

(a) Control category contains blocks that start or stop a script.

(b) You can even load own sprite from a file.

(c) You can grow a sprite but cannot shrink it.

(d) Pen down command stops the drawing on the stage.

(e) Backdrops are the backgrounds for the stage.

Answer

(a) True
Reason — The Control category or Events category in Scratch contains blocks like "when green flag clicked" to start a script and "stop" blocks to halt the script's execution.

(b) True
Reason — In Scratch, we can import our own sprite images from files to use in our projects, enhancing customization.

(c) False
Reason — In Scratch, you can both grow and shrink a sprite using the "change size" block in the Looks category.

(d) False
Reason — The "pen down" command in Scratch actually starts the sprite drawing on the stage, allowing it to leave a trail behind as it moves.

(e) True
Reason — The background that we see on the stage is the backdrop.

Question 6

Look at the section of code below that controls a sprite.

Write down what you think the user will see when the green flag is clicked. Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.
Write down what you think the user will see when the green flag is clicked. Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.

Write down what you think the user will see when the green flag is clicked.

Answer

First section of code — When the green flag is clicked, the sprite will move 10 steps towards the right direction.

Second section of code — When the green flag is clicked, the sprite will move 10 steps towards the left direction.

Question 7

In the stack of blocks below, how many times does the sprite move 10 steps?

In the stack of blocks below, how many times does the sprite move 10 steps? Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.

Answer

Eight times.

Explanation

CodeNo. of times sprite moves 10 stepsRemarks
move 10 steps1 timeThe sprite moves 10 steps once.
repeat 3
      move 10 steps
      move 10 steps
6 timesThe sprite moves 10 steps two times inside the repeat block. The repeat block executes 3 times.

2 * 3 = 6 times

Thus, the sprite moves 6 times inside the repeat block
move 10 steps1 timeThe sprite moves 10 steps once.

Thus, the total number of times the sprite moves is 8 (1 + 6 + 1).

Question 8

What is the job of the 'forever' script ?

Answer

The forever block repeats a set of actions forever. For example,

when green flag clicked
forever
    move 100 steps
    if on edge, bounce

Question 9

What instructions would I use if I wanted a loop to execute 10 times ?

Answer

I would use the command repeat 10 if I wanted a loop to execute 10 times.

Question 10

What is a loop ?

  1. A loop is a conditional statement that needs to be directed for it to work
  2. Tells sprites what to do
  3. Changes the font a word
  4. It's the hole in the ground

Answer

A loop is a conditional statement that needs to be directed for it to work

Reason — The blocks that let us repeat a certain action or a group of actions are called loop blocks. For example, repeat, forever and repeat until are loop blocks.

Question 11

What is an infinite loop or continuous loop ?

Answer

A never ending loop is known as an infinite loop or continuous loop. The forever command creates an infinite loop in Scratch.

Question 12

What is an if-statement ? Give two examples.

Answer

The if block from Controls category is used when we have to take an action depending upon a certain condition. It allows a program to execute certain actions only if a specific condition is true. If the condition is false, the actions within the if-statement are skipped.

Consider the following examples:

1. If we want our sprite to move to the center of the stage when it touches the edge of stage, we can use the given script:

if touching edge then
    go to x : 0 y : 0

2. If we want our sprite to say "You win" when it touches another sprite (ball), we can use the given script:

if touching ball then
    say "You win"

Application Oriented Questions

Question 1

Carefully go through some sample scripts given below. What is happening in each of these scripts ?

 What is happening in this script? Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.
 What is happening in this script? Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.
 What is happening in this script? Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.

Answer

Script 1

When the sprite is clicked, it will repeatedly move 5 steps in the direction it's facing. If it reaches the edge of the screen, it will bounce back and continue to move 5 steps infinitely.

Script 2

When the sprite is clicked, it will repeatedly move 5 steps in the direction it's facing. If it reaches the edge of the screen, it will bounce back and it will also gradually rotate clockwise if it's facing right, or anticlockwise if it's facing left.

Script 3

When the green flag is clicked, the sprite will face to the right, resize to 60% of its original size and move to the position with coordinates (-100, -70). It will check if it's touching another sprite named "Sprite1". If it is, it will display the text "Woof!" in a speech bubble for 2 seconds.

Question 2

How are following two scripts different from one another ?

How are following two scripts different from one another? Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.
How are following two scripts different from one another? Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.

Answer

The key distinction between the given scripts is that in the first script, the "Woof!" message will be displayed once when the sprite is touching "Sprite1". In the second script, because of the forever loop, the "Woof!" message will be repeatedly displayed every time the sprite is touching "Sprite1", as long as the program is running.

Question 3

Create a fun game in scratch where there are two sprites on the stage cat sprite and a ball sprite. Ball is forever moving on stage. The cat sprite's movement is controlled by pressing all arrow keys : up/down/left/right. If the cat sprite touched the ball sprite, it exclaims "Hurray!!".

Answer

Below is the scratch script for the game:

Create a fun game in scratch where there are two sprites on the stage cat sprite and a ball sprite. Ball is forever moving on stage. The cat sprite movement is controlled by pressing all arrow keys : up/down/left/right. If the cat sprite touched the ball sprite, it exclaims Hurray. Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.

Lab Activity

Question 1

Write a script/program to draw a heptagon on the stage.

Answer

Below is the scratch script to draw a heptagon on the stage:

Write a script/program to draw a heptagon on the stage. Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.

Question 2

Write a script/program to draw an Octagon on the stage.

Answer

Below is the scratch script to draw an octagon on the stage:

Write a script/program to draw an octagon on the stage. Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.

Question 3

Using drawing commands, carefully design a script to draw the adjacent figure on the stage.

Using drawing commands, carefully design a script to draw this figure on the stage. Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.

Answer

Below is the scratch script to draw the house on the stage:

Using drawing commands, carefully design a script to draw this figure on the stage. Scratch Programming I, Computer Applications Code 165 Sumita Arora Solutions CBSE Class 9.
PrevNext