Search This Blog

Sunday, 30 January 2022

UNIT 07. INTRODUCTION TO SCRATCH - Text Book Exercise And Question Answers - Computer Science For Class X

GO TO INDEX

Computer Science For Class X
Unit 07: Introduction To Scratch
Question Answers

By Mrs. Ayesha Arif
Vice Principal
(Jauhar Progressive School)


Q.1: What is scratch ? Give some of its advantages.
Ans: SCRATCH:
Scratch is a visual programming language. It is very easy to create programs in scratch. It allows students to create their own interactive stories, games and animations, etc. This programming tool was developed by Massachusetts Institute of Technology (MIT) Media Lab . It is free to use and distribute and it will remain free forever.

ADVANTAGES OF SCRATCH:
Scratch can be used for multiple purposes:
  • Interactive stories ,games ,animations, music, art and presentations can be created simply by dragging and dropping colour blocks.
  • While working with scratch students learn important mathematical and computing concepts that improve their creative thinking and logical reasoning problem solving.
  • As students design Scratch projects, they learn to think creatively, reason systematically, and work collaboratively.
  • kids can create animation easily by using scratch.
  • Teens can develop games.
  • Teachers and students can use it to create effective education tools such as math quiz, science simulation and educational videos.
  • It is so easy to use that anyone can master it within short period of time.

Q.2: Write down the procedure and steps to download and install scratch offline and online.
Ans: Downloading And Installing Scratch Offline:
  • Scratch can be downloaded or installed on computer or any android device to work offline.
  • The latest version can be downloaded for Windows 10 or Android 6 or the later versions.
  • Scratch 2.0 is a good version that can work on most of the computers and can be downloaded from website:
    http:// scratch.mit.edu/download/scratch 2


OFFLINE INSTALLATION:
Installation of scratch is very easy. The instructions for installation of Scratch 2.0 are given below:
  • To begin scratch Offline Editor for Windows needs to be installed on computer.
  • After down loading we need to just run the executable (.exe) file.
  • The first screen will appear which will ask the location where we want to install the Scratch.
  • It will also ask about the shortcuts to create. We need to just continue with default options.
  • This will initiate the installation process and after installation, Scratch will be ready to use.


SCRATCH ONLINE INSTALLATION:
  • Scratch can also be used online by simply loading its editor in our web- browser which is available at:
    https:// scratch.mit.edu/projects /editor
  • After loading the editor, it will function just like the offline editor.
    We can also create our account on Scratch. This will enable us to save our projects online.


Q.3: What do you know about Sprite and script?
Ans: SPRITE:
The sprites are the images of cartoons, characters or objects that we add in our project. We can have multiple sprites in our project but at least one sprite is always needed for the project. Cat is the default sprite in scratch.


SCRIPT:
To create a game, interactive story, animation or art work in scratch, We must add visual instructions to tell a sprite exactly what to do. The scripts are instructions that make sprites perform a task. Each sprite in a scratch project has an area for scripts through which it is programmed. Clicking on a script's thumbnail in the sprite pane will bring up the script area of that sprite.
OR
The scripts are the visual instructions to tell a sprite what to exactly do. In short, Scripts are the instructions in a visual form that make a sprite perform a specific task.


Q.4: Write in detail about the different components of scratch editor.
The scratch editor has the following components:
  1. Stage or stage preview
  2. Script area
  3. Sprite list
  4. Backdrop
  5. Script block
  6. Script tab
  7. Costume tab
  8. Sound tab
  9. Cursor tool

1. Stage or stage preview:
  • It is the main working area where the spite moves and performs actions according to the given instructions.
  • Here we can immediately see the output of our codes.
  • The project runs physically in this window.
  • It is divided into X (horizontal) and Y (Vertical) co ordinates. The coordinates are displayed at the bottom right corner of the stage.
  • These coordinates indicate the position of the sprite on stage.

2. Script area:
  • This is the area where the code or program is seen.
  • Blocks from the palette can be dragged to this area and create scripts by placing them together.
  • Script is the set of step wise instructions that we give to the Sprite to do a particular task.
  • Each sprite has its own script area.

3. Sprite list:
  • It displays the thumbnails of all the sprites available in a project.
  • The blue information icon can be clicked on any sprite to change its name or behavior.

4. Back drop:
  • A backdrop is a background that can be added to the stage.
  • By default, no backdrop is added in a project.
  • The look of the stage can be altered by adding a backdrop.

5. Script Block:
  • Script area has three different tabs.
  • A tab is a small area that contains similar commands or options.

6. Script Tab (code tab in scratch 3):
  • This area can be considered as tool box.
  • On clicking this tab block palette is opened.
  • The sprites are used to give commands.
  • A command is an instruction to do specific task.
  • In scratch these commands are shown in the form of Code Blocks in the Block Palette.
  • The block palette consist of every block of instruction that is built into scratch.
  • The commands regarding a specific task are joined together in different blocks.
  • Each block has associated colour that differentiate different commands.
  • Some blocks and their purposes are as follows:
    1. Motion: These codes are used to move Sprite on the stage.
    2. Event: Event trigger specific codes at a particular time or action.
    3. Sound: is used to play different sounds.
    4. Looks: These codes are used to change the appearance of sprite and backdrop.
    5. Control: These codes are used to control the action on the stage.
    6. Sensing: These codes are used to sense any specific happening.
    7. Data: These are used to initialize variables and list.
    8. Pen: This used to draw lines, rectangles and other shapes.
    9. Arithmetic: This shows the available logical and relational operators.

7. Costume tab:
  • By clicking on the "Costumes" tab the appearance of a sprite can also be changed into the desired costume of choice.
  • It can also be changed by using blocks to select the sprite’s costume.
  • New costumes for the sprite can be Imported, Created, and Edited in the Scratch Paint Editor.


8. Sound Tab:
  • Sound is an optional field. We can have sprites with no sounds.
  • Some sprites additionally have at least one sound.
  • The sounds tab allows to add, delete, and edit sounds.
  • Sounds can be played in the sound editor or with blocks that play a specific sound.


9. Cursor tool:
  • Cursor Tool is located on the right top of the editor.
  • It includes five options; Duplicate, Delete, Grow, Shrink and Help.
  • To Duplicate a sprite, just click on the stamp and then on the Sprite.
  • Same is applicable on Delete, Grow and Shrink.


Q.5: Name the blocks of script tab along with their purpose and examples.
Ans: BLOCKS WITH THEIR PURPOSES AND EXAMPLES:
BLOCK PURPOSE EXAMPLES
Motion These codes are used to move the Sprite on stage. Move; Turn; go to x,y; if on edge, bounce;
Events Events triggers specific code at a particular time or action. When flag is clicked; when space key is pressed, when backdrop switches to.
Sound This is used to play sound. Play sound; play drum 1 for 0.25 beats, play note 60 for 0.5 beats.
Looks These codes are used to change the appearance of the sprite and Backdrop. Say; think, switch costume to and switch Backdrop to are some commonly used codes.
Control These codes control the actions on the stage. Wait 1 sec, repeat 10, forever, if then.
Sensing These codes sense any specific happening. Touching mouse pointer, touching colour, ask and wait.
Data These are used to initializes variables and lists. Variable and lists.
Pen This is used to draw rectangles ,lines and other shapes. Pen up, pen down, pen colour.
Operators This shows available arithmetic, logical and relational operators. +; -; *; /; <; >; =


Q.6: What points should be kept in mind before developing a project? And What steps are generally taken to develop a simple program in scratch?
Ans: POINTS TO BE KEPT IN MIND BEFORE DEVELOPING A PROJECT:
The following points should be kept in mind before developing a project:
Most of the Scratch Programs contain Sprites, Backdrops and Code Blocks.
Every Sprite in a program has a separate Code Block which controls its actions.
We can develop programs for different logics like storytelling, sprite animation, simple game and others.

STEPS TO DEVELOP A SIMPLE PROGRAM:
Following are the general steps to develop a program in scratch:
Open Scratch Editor
  • Events:
    From Events Option in Script, drag and drop on script area.

  • Control:
    From Control Option, drag forever and drop on script area. Inside the forever block, drag and drop the illustrated commands and change values accordingly. Colors will help you to find the option. After completing the codes blocks, Play (Run) and Stop the program.


  • Playing and Stopping the Animation/Program:
    To start your program or to test your code click the Green flag icon located above the Stage panel. To stop your program, click the Red Stop icon.


  • Coordinates On Scratch Stage:
    Scratch has two dimensional (2D) coordinate system; "X" position which and "Y" position to determines the location of a sprite on the stage. The "X position value determine the horizontal location of the sprite and "Y" position value determines the vertical location.
    The screen in scratch is a 480 x 360 rectangle. The "X" position can range from -240 to 240, where -240 is the leftmost a sprite can be and 240 is the rightmost. "Y" position can range from 180 to -180, where 180 is the topmost it can be and -180 is the bottom-most it can be.



Q.7: Explain this program of scratch? Or What is the Output of this program?


Ans: Program Explanation:


  • When clicked: It is an event. It runs the program when flag is clicked.
  • Forever: block keeps repeating the commands for infinite time.
  • Moves 20 steps: Goes to next costume. Moves sprite 20 steps forward.
  • Wait 0.5 seconds: Makes sprite wait for (0.5) seconds.
  • if on edge, bounce: When sprite touches corner. it returns back.
  • set rotation style [left-right]: This keeps turning the direction left-right.

OUTPUT:


Q.8: List some important commands in scratch with their purpose.
Ans: SOME IMPORTANT COMMANDS IN SCRATCH:
Some important commands which are usually used to developed simple programs are:





B. RESPOND THE FOLLOWING:


1. Explain the following:
i. Script
ii. Sprite
iii. Backdrop

Ans: For Script and Sprite see above Q.2 and
For Backdrop see above Q.3.

2. State the difference between repeat 10 and forever commands.
Ans: Difference Between Repeat 10 and Forever Commands.
  • Forever: Forever command keeps on repeating the command for infinite times.
  • Repeat 10: While repeat 10 command repeats the command only for 10 times.

3. Write the use of the following codes: forever, wait, say, play sound, go to x, y?
Ans: Codes With Their Uses:
S.NO. Words
forever Keep repeating the code blocks for infinite times
wait Makes sprite waits for specific seconds
Play sound Used to play specific sound
say Commands the spite to say words or phrase in a specific seconds
Go to x, y Make the sprite move to specific location at x or y coordinates (position on stage).


4. What is the difference between using scratch online and offline?
Ans: Difference Between Using Scratch Online And Offline:
There is a difference between using scratch online and offline.
Scratch Online:
  • In Online scratch we can communicate with the community and see shared projects of others.
  • Online we can also share our own projects.
  • Discussions and chats can also be done while using on line scratch.

Scratch Offline:
  • While using scratch offline we can only make projects and upload or download them to usb's.

10. How are colours helpful for the user?
The colours in script tab are helpful for the user in the following ways:
  1. The colours prevent the user from getting confused.
  2. The colours code makes it easier for the user to use different commands.
  3. When there are too many scripts in one sprite the colours make it easier to find them.


5 comments:

  1. HE IS IN DANGER10 May 2022 at 10:00

    GOOD HO GYA G

    ReplyDelete
  2. HE IS IN DANGER10 May 2022 at 10:00

    GOOD HO GYA G

    ReplyDelete
  3. Please complete the question 4 from section b

    ReplyDelete
  4. Keep making the notes all the best💞

    ReplyDelete