Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore Digital book Class 4 2nd edition

Digital book Class 4 2nd edition

Published by Memorica Graphics, 2023-03-23 15:11:27

Description: Digital book Class 4 2nd edition

Search

Read the Text Version

Coordinate System in Scratch Scratch's coordinate system uses 2 coordinates, 'X position' and 'Y position' to determine the location of a sprite on the stage. The 'X position' value determines the horizontal location of the sprite and the 'Y position' value determines the vertical location or height. The screen of stage having 480x360 tiny rectangles with the origin in the center, such that the X position can range from 240 to -240, where 240 is the right- most and -240 is the left-most, and the Y position can range from 180 to -180, where 180 is the highest and -180 is the lowest position. This sprite is positioned in 0,0 coordinate which represents center of the Page Scratch Coding 146

stage. To set the coordinate of sprite, just set the desired value of X and Y in the Sprite pane. Programming Code Programming codes are blocks of code. We get these Code blocks under the 'Code' tab. Step-1 : Click the Code tab. Step-2 : Select 'Types' Step-3 : Select block and then drag it onto your scripts pane or code area. Types of Block in Scratch Scratch gives you different categories of block. Each of which includes a number of blocks that you can use to do jobs. These are: 1. Motion 2. Looks 3. Sound 4. Events 5. Control 6. Sensing 7. Operators 8. Variables 9. My blocks Smart Page Computer Science Book-4 147

Delete a block Scratch allows us to delete a block of instruction. To delete a block, do the followings: Steps to Follow: Step-1 : Click the instruction block. Step-2 : Press 'Del' Key from the keyboard. If you want to delete a group of block, then do the following Step-1 : Right mouse click on Step-2 the blank area. : Click the 'Delete' option of context menu. Here, 3 block of statements are going to delete. You can click and drag the block towards the block pallet to delete a block or group of blocks SCRIPT WRITING IN SCRATCH Script is a collection of stepwise instruction that are given to a sprite to do a specific task. A script consists of at least two blocks. The script is created by dragging the instructions from the blocks palette and dropping them stepwise top of each other. Script is also called a program. Working with Basic Code Blocks Page It is an event block, also called start block. This block is used to start the program. It is available in the 'Event' 148 group. This block is used to display information for mentioned time. It is available in the 'Looks' group. Scratch Coding

This block is used to hold the time for certain time. It is available under the 'Control' group. Sample Program Let's create a simple conversation story of butterfly and dog. Code for Butterfly Code for Dog Smart Page Computer Science Book-4 149

This block is used to hide a character. It is available in the 'Looks' group. This block is used to show a hidden character using hide code block. It is available in the 'Looks' group. Sample Program Let's create a simple conversation story of dog and cat. Code for Dog Code for Cat Page Scratch Coding 150

Lab Activity-8 1. Let's write programs for these sprites as given in demo. a. Scan for demo b. Smart Page Computer Science Book-4 151

We pickup this block from Motion category. It is used to move the sprite in the specified X and Y coordinate of the stage. We pickup this block from Motion category. It is used to move the sprite forward/backward in the specified number of steps. To move back ward, specify the negative value. We pickup this block from 'Control' category. It is used to repeat action/s for the specified number of times. We should place the block/s inside it to repeat the action/s. We pickup this block from 'Looks' category. It is used to switch/change the costume of sprite. Sample Program Let's create a program using these blocks. The program should move the sprite cat forward. Page Scratch Coding 152

Lab Activity-9 1. Let's create a program to move this sprite forward. Scan for demo Sample Program Let's create a program. The program should walk the sprite forward with switching costume. Smart Page Computer Science Book-4 153

LabActivity-10 1. Let's create a program to move this sprite forward with switching costume. Scan for demo Sample Program-4 Let's create a program to move this sprite cat backward. Page Scratch Coding 154

Lab Activity-11 1. Let's create a program to move this sprite backward. Scan for demo Sample Program-5 Let's create a program to walk this sprite cat backward with changing its costume. Smart Page Computer Science Book-4 155

Lab Activity-12 1. Let's create a program to walk this sprite backward with changing its costume. Scan for demo We pickup this block from 'Motion' category. It is used to turn the sprite right for number of specified steps . We pickup this block from 'Control' category. It is used to repeat the task forever until the stop button is pressed. Sample Program Let's create a program to turn the sprite 10 degree right forever until the stop button is pressed. Page Scratch Coding 156

We pickup this block from 'Motion' category. It is used to turn the sprite left for number of specified steps . Sample Program Let's create a program to turn the sprite cat 10 degree left forever until the stop button is pressed. We pickup this block from 'Looks' category. It is used to change the next costume. We can pickup this block from 'Motion' category. It is used to set the direction for the sprite. Here, it is set 90 degree. Smart Page Computer Science Book-4 157

Sample Program Let's create a program using given set of instructions for following backdrop and sprite butterfly. Lab Activity-13 1. Let's create a program to fly this sprite parrot as given in demo. Scan and view demo. Page Scan for demo 158 Scratch Coding

We pickup this block from 'Motion' category. It is used to set the movement either random position or mouse pointer for specified time. We pickup this block from 'Motion' category. It is used to set the movement for specified value of X and Y. Sample Program Let's create a program using given set of instructions with the given sprite and backdrop. Smart Page Computer Science Book-4 159

We pickup this block from 'Motion' category. It is used to change value of X by specified number of steps . We pickup this block from 'Motion' category. It is used to change value of Y by specified number of steps. Sample Program Let's create a program using given set of instructions for following backdrop and sprite cat. Page Scratch Coding 160

Lab Activity-14 1. View demo and create programs: a. Scan for demo b. Smart Page Computer Science Book-4 161

We pickup this block from 'Sound' category. It is used to add sound to the sprite. Sample Program Let's create a program with the given set of instructions for the Roster sprite with given backdrop . Lab Activity-15 1. Create a program for this dinosaur sprite as given in demo. Scan and view demo. Scan for demo Page Scratch Coding 162

Flipping Costume Some times, it is necessary to flip the sprite custom horizontally or vertically. To flip the Costume, do the following. Step-1 : Select the Sprite. Step-2 : Go to the 'Costume' tab. You get the Costume window. Step-3 : Select the 'Costume' to flip. Step-4 : Select the desired flipping option either 'Flip horizontal' or 'Flip vertical'. Making Duplicate Costume To make duplicate costume, do the following. Step-1 : Select the Sprite. Step-2 : Go to the 'Costume' tab. You get the Costume window. Step-3 : Select the 'Costume' and right mouse click. Step-4 : Select the 'Duplicate' option. Smart Page Computer Science Book-4 163

Sample Program Let's create a program with the given set of instructions for the Cat Sprite with given cat's costumes. Page Scratch Coding 164

Lab Activity-16 1. Let's create a program for these cat and snake sprites as given in demo. Scan and view demo. Scan for demo Conditional Code Blocks Conditional code blocks in Scratch programming are used to make decisions based on the conditions. These make the choice in the program. We learn two types of conditional code blocks. i) If..Then and ii) If...then...else We can pickup this block from 'Control' category. This IF statement is a decision-making statement that guides a program to make decisions based on specified criteria. The IF statement executes set of code block mentioned after 'then' if a specified condition is met (TRUE). Smart Page Computer Science Book-4 165

Operators Code Blocks Operators is one of the categories of Scratch blocks. They are color- coded light-green, and are used to perform the math equations and string handling tasks. Scratch 3.0 has the following 7 Boolean Operators and 11 Reporter Operator blocks: Page Scratch Coding 166

We pickup this block from 'Operator' category. The () = () block is an operator block which comes within a boolean block. The block checks if the first value is equal to the second value. If the values are equal, the block returns true; otherwise, it returns false. Input/output Code Blocks Input can be as simple as pressing a key to make something happen. The output is the action that results. For example, the input of pressing the up arrow key will make a sprite move forwards. The input can be a number that will be entered as a variable and used for a calculation. The output could be the answer to a maths problem. We pickup this block from 'Sensor' category. It allows us to type something for the computer. So, it is used for input operation. We pickup this block from 'Sensor' category. This block returns the most recent text inputted with the Ask () and Wait block. Smart Page Computer Science Book-4 167

Sample Program Let's create a program with the given set of instructions for the Cat Sprite with given backdrop. Sample Program Let's create a program with the given set of instructions for the Cat Sprite with given backdrop. Page Scratch Coding 168

Lab Activity-17 1. Let's create a program for this sprite cat as given in demo. Scan and view demo. If you press right arrow, cat says \"You have pressed right arrow and cat move 10 steps forward. Scan for demo 2. Let's create a program for this sprite cat. Cat moves forward, if you press right arrow. If you press left arrow, cat turns back and moves back. Scan and view demo. Scan for demo Smart Page Computer Science Book-4 169

We pickup this block from 'Control' category. The IF statement is a decision-making statement that guides a program to make decisions based on specified criteria. This IF...then... else statement executes first set of code block if a specified condition is met (TRUE). otherwise (FALSE), it executes set of code block mentioned after 'else'. Sample Program Let's create a program with the given set of instructions for the Cat Sprite with given backdrop. Page Scratch Coding 170

Lab Activity-18 1. Let's create a program for this sprite cat. Computer allows us to ask time and check it. If the time is 10 o'clock, Sprite says, correct, it is office time. Start to work. Otherwise, Sprite says, incorrect, it is not office time. Go back to home. Scan for demo Scan for demo Smart Page Computer Science Book-4 171

Points to Know • Scratch is a high-level block-based visual programming language. • Scratch developed by MIT (Massachusetts Institute of Technology) • The Scratch editor is where you snap code blocks together to create your game, animation, or artwork. • A Sprite is an object in Scratch that performs functions controlled by scripts. • A backdrop is an image that can be shown on the Stage. It is also called the background of the stage. • A costume is alternate appearance of a sprite. • Script is a collection of stepwise instruction that are written to do a specific task. • Conditional code blocks in scratch programming are used to make decisions based on the conditions. • Input can be as simple as pressing a key to make something happen. • The output is the action that results Terms to Know Scratch : A kind of programming language Sprite : A object on a Scratch computer program screen which acts as given code blocks Online : A computer or a user is connected to the Internet Scratch Interface : The area on screen where the scratch program exists User Account : An identity created for a person in a computer High level language : Programming language that enables development of a program in user-friendly way Scratch Code Editor : The space where you snap code blocks together Programming : A way to instruct the computer to perform various tasks Boolean : Two possible values: true or false Garbage : Rubbish or waste things Page Scratch Coding 172

Worksheet Objective Questions 1. Fill in the blanks with correct word garbage backdrop two sprite cat blocks MIT green horizontal script conditional vertical operators a. Scratch is developed by........................... b. .............................. is an object in scratch that performs functions con- trolled by scripts. c. Default sprite is ............... in the scratch. d. We can easily delete the sprite by clicking on ................... icon. e. ............................. is the background of our sprite in the program. f. The ................. flag is clicked to start the project. g. .................... are used to create code in scratch. h. Scratch's coordinate system uses .................. coordinates. i. The 'X' position value determines the ............................ location of the sprite. j. The 'Y' position value represent the ...................... location of the sprite. k. ....................... is a collection of stepwise instruction that are given to a sprite to do specific. l. ............................ code block makes choice in the program. Smart Page Computer Science Book-4 173

m. ............................... code blocks are used to sprite math equations and string handling. 2. Write 'T' for true and 'F' for false statements: a. Scratch is a high level programming language. b. We need not to type in scratch. c. Scratch is a browser based free access program. d. The offline editor of Scratch can be installed on our computer. e. User name and password are public information. f. We can change sprite in scratch. g. The red flag is clicked to stop the project. h. The stage is the background of the project. h. There is a blank backdrop by default in the scratch editor. i. Sprite can be shown or hidden. j. Every sprite must have at least one costume. 3. Select the correct option: a. The screen of stage having rectangles: i) 480x360 ii) 240x240 iii) 180x180 b. X position can range in the coordinate: i) 240 to 240 ii) 240 to -240 iii) 480 to 360 c. Y position can range in the coordinate i) 180 to -180 ii) 240 to -240 iii) 180 to 180 Page Scratch Coding 174

d. The lowest position of 'Y' is the : iii) None of these i) -180 ii) 180 e. The highest position of 'Y' is the iii) 240 i) -180 ii) 180 f. Right most value of 'X' is the iii) 180 i) 240 ii) -240 g. Left most value of 'X' is the iii) -180 i) -240 ii) 240 h. The center position of sprite is i) 0,0 ii) 1,1 iii) 240,240 4. Match the following: a. Turn left b. Turn right d. Input operation e. Output operation f. Decision making g. Boolean operator Smart Page Computer Science Book-4 175

5. Answer the following questions: a. What is Scratch? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. ................................................................................................................. b. Why is Scratch called block-based programming language? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. ................................................................................................................. c. What can we do in Scratch? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. ................................................................................................................. d. What does Scratch help us? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. ................................................................................................................. Page Scratch Coding 176

e. Differentiate between online and offline Scratch editor. Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. ................................................................................................................. f. What is Sprite? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. g. What is stage? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. h. What is Sprite costume? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. i. What do you mean by Input/Output? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. Smart Page Computer Science Book-4 177

................................................................................................................. k. Why do you use conditional code block? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. ................................................................................................................. Case Study and Application-based Questions a. Shree Krishna Belbase wants to write programs in Scratch but he doesn't have internet access and wifi. How should you suggest to use Scratch in this situation? Ans: ........................................................................................................ ................................................................................................................. b. Shiva Ji Baniya wants to repeat a task for certain number of times, which code block should he use? Ans: ........................................................................................................ ................................................................................................................. c. Parbati Ramtel wants to move the sprite by 5 steps forward until he press the red flag (stop) button. In such a case which code block should she use for this case? Ans: ........................................................................................................ ................................................................................................................. Page Scratch Coding 178

d. Manita Khanal has to turn back the sprite. In this case what should she do? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. e. Shiva Ram Ramtel wants to write a program where if he presses the down arrow key, sprite should move downward. If he presses the up arrow key, sprite should move upward. In this case, which code block should he use for taking the decision either up or down? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. Smart Page Computer Science Book-4 179

Lab Activity-19 1. Let's create a program using the given set of instructions with the given back drop and sprite. Scan and view the demo. Scan for demo Page Scratch Coding 180

Lab Activity-20 1. Let's create a program using the given set of instructions with the given back drop and sprite. Scan and view the demo. Smart Scan for demo Page Computer Science Book-4 181

Lab Activity-21 1. Let's create a program using the given set of instructions with the given back drop and sprite. Scan and view the demo. Scan for demo Page Scratch Coding 182

Lab Activity-22 1. Let's create a program using the given set of instructions with the given back drop and sprites chick and egg. Scan and view the demo. Scan for demo Page Smart 183 Computer Science Book-4

Class-IV Model Question (Theory) Computer Science Time 1 hr. 30 Minutes F.M. 50 Group 'A' (15 Marks) Objective knowledge-based questions 1. Write the correct word in the blank spaces. (5 x 0.5= 2.5) docx icons abacus electronic desktop a. Computer is an .......................... data processing device. b. ............................ is the first calculating device. c. The ......................... memory is a permanent memory of computer. d. The small pictures shown in the desktop are known as ..................... e. MS-Word automatically adds ...................... extension to the file name. 2. Write the 'T' for true and 'F' for false statement. (5 x 0.5= 2.5) a. Computers feels tired and bored after doing certain work. b. Every sprite must have at least one costume. c. Fourth generation of computer is based on IC. d. Primary memory is the main memory. e. A folder may contain another folder. Page Model Question (Theory) 184

3. Write the Full Forms (5 x 0.5= 2.5) a. VLSI .............................................................................................. b. ALU ............................................................................................... c. IC .................................................................................................. d. VDU ............................................................................................... e. CU ................................................................................................. 4. Match the followings (5 x 0.5= 2.5) a. First mechanical computer Difference Engibe b. Processing unit CPU c. Operating system Windows d. To make bold Ctrl+B e. To close document Ctrl+B 5. Write the technical terms for the followings: (5 x 0.5= 2.5) a. Ground part of the screen. Ans: ....................................................................................................... b. Order to do something. Ans: ....................................................................................................... c. Operated by use of machinery or tools. Ans: ....................................................................................................... Smart Page Computer Science Book-4 185

d. Supplying data into the computer. Ans: ....................................................................................................... d. A separate viewing area on a computer display screen. Ans: ....................................................................................................... 6. Mark the correct answer (5 x 0.5= 2.5) a. In the scratch coordinate, right most value of 'X' is: i) 240 ii) -240 iii) 180 iv) None of these b. In the scratch coordinate, the center position of sprite is: i) 1,1 ii) 0,0 iii) 240,240 iv) 180,180 c. Input device: ii) Mouse i) Keyboard iv) All of these iii) Joystick d. Secondary memory: ii) Hard disk i) CD-ROM iv) All of these iii) Solid-state drive (SSD) ii) CPU e. Computer program: iv) None of these i) MS-Paint iii) ROM Page Model Question (Theory) 186

Group 'B' (10 Marks) (5 x 2 =10) Descriptive Questions 7. Answer the following questions in short: a. Why is Charles Babbage called father of compute? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. b. Why is computer called versatile machine? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. ................................................................................................................ c. What is file? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. d. What is word processing? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. e. What is computer memory? Ans: ........................................................................................................ ................................................................................................................. ................................................................................................................. Smart Page Computer Science Book-4 187

Group 'C' (10 Marks) Case Study and Application-based Questions 8. Study the following cases and answer the asked questions (4x 2.5=10) a. Jokhani Marik wants to display beautiful animated image on the monitor, when her computer is idle for certain time. For this case, which feature would you like to suggest Jokahni? Ans: ........................................................................................................ ................................................................................................................. b. Ramananda Yadav plays game in the computer. He feels uneasy to play game with common input device. Which device would you like to suggest Ramanada for playing game easily? Ans: ........................................................................................................ ................................................................................................................. c. Dharma Dutta Devkota has created a lot of files and folders on the desktop. He wants to remove unnecessary files and folders from his computer, what would Dharma Dutta do for this case? Ans: ............................................................................................................................ ..................................................................................................................................... d. When you are painting, due to some problem you might want to go back just three times previous situation. In this case which technique do you apply? Ans: ............................................................................................................................ ..................................................................................................................................... .................................................................................................................................... Page Model Question (Theory) 188

Group 'D' (15 Marks) Imaginative and logic-based questions 9. Study the given code blocks, and write a note about its result: (2x5=10) a. . Ans: ............................................................................................................................ ..................................................................................................................................... ..................................................................................................................................... ..................................................................................................................................... b. Ans: ............................................................................ ..................................................................................... ..................................................................................... .................................................................................... ..................................................................................... ..................................................................................... ..................................................................................... ..................................................................................... .................................................................................... .................................................................................... Smart Page Computer Science Book-4 189

10. Write your step by step logical note to draw the following logo in the MS-Paint (5) Ans: ............................................................................................................................. ...................................................................................................................................... ...................................................................................................................................... ...................................................................................................................................... ...................................................................................................................................... ..................................................................................................................................... ..................................................................................................................................... ..................................................................................................................................... ..................................................................................................................................... ...................................................................................................................................... ...................................................................................................................................... ..................................................................................................................................... Page Model Question (Theory) 190

Class-IV Model Question (PRACTICAL) Computer Science Time 1 hr. 30 Minutes Full Marks: 50 1. Write the Scratch code blocks to move the ball as indicated. (1x10=10) 2. Draw the following logos in MS-Paint. (2x5=10) a. b. Smart Page Computer Science Book-4 191

3. Open the typed document and format as indicated in the MS-Word. (1x5=5) A Glass of Milk There once was a poor boy who spent his days going door-to-door selling newspapers to pay for school. One day, as he was walking his route, he started feeling low and weak. The poor boy was starving, so he decided to ask for food when he came to the next door. The poor boy asked for food but was denied every time, until he reached the door of a girl. He asked for a glass of water, but seeing his poor state, the girl came back with a glass of milk. The boy asked how much he owed her for the milk, but she refused payment. Years later, the girl, who was now a grown woman, fell sick. She went from doctor to doctor, but no one was able to cure her. Finally, she went to the best doctor in town. The doctor spent months treating her until she was finally cured. Despite her happiness, she was afraid she couldn’t afford to pay the bill. But, when the hospital handed her the bill, it read, ‘Paid in full, with a glass of milk.’ By: Google Page [ 25 marks for internal assessment and activity ] 192 Model Question (PRACTICAL)

Smart Page Computer Science Book-4 193


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook