Computer Science
About the Book This book embodies the principles outlined in the National Education Policy (NEP) 2020. It unveils the world of computer science through a unique and captivating pedagogical approach—seamlessly integrating curriculum content into the mesmerizing adventures of Mel and Conji, fictional figures hailing from the enchanting world of Avora. Our aim is to prepare learners for the dynamic and technology-driven landscape of the 21st century, equipping them with the essential skills they need to thrive in an ever-evolving world.
(TERM II)
Special Features • Explore More: QR codes to explore an exciting application of the concept. This element builds curiosity in children and helps them grasp concepts through digital visual aids. 2
• Discuss: Questions to trigger engaging group discussions in the classroom. • Think and Tell: Probing questions to stimulate thinking at an individual level. • Did You Know? Interesting facts related to the application of a concept. • Points to Remember: Chapter end summary. • Do It Yourself: Milestone exercises to practice specific concepts. • Chapter Checkup: A pool of questions catering to all topics and skills covered in the chapter.
About Uolo Uolo partners with K-12 schools to bring technology-based learning programs. We believe pedagogy and technology must come together to deliver scalable learning experiences that generate measurable outcomes. Uolo is trusted by over 10,000 schools across India, South East Asia, and the Middle East.
Singapore
|
Gurugram
CS_CB_Grade2_ICSE_Cover_CMT2.indd All Pages
|
Bengaluru
|
hello@uolo.com �205
© 2024 Uolo EdTech Pvt. Ltd. All rights reserved.
NEP 2020 based
|
ICSE compliant | Technology powered
25/01/24 6:08 PM
ICSE
COMPUTER SCIENCE Grade 2 Term II
Lost and Found
CS24_CB_FM_Grade2.indd 1
25/01/24 5:41 PM
Foreword
Standing at the forefront of the digital and AI revolution, the importance of coding and computational skills has reached unprecedented heights. In today’s professional landscape, whether it’s in the fields of medicine, space exploration, education, science, or business, no sector remains untouched by this transformative wave. To not just survive but thrive in the 21st century, basic computer literacy is no longer sufficient. Learners must evolve into “digital natives” who can fluently read, write, and communicate in the languages that machines and AI comprehend. Recognizing this imperative, the National Education Policy of 2020 (NEP 2020) has strongly recommended the integration of coding skills, computational thinking, critical analysis, and problem-solving abilities into the curriculum. Moreover, forward-looking subjects like AI, Data Sciences, Computer Applications, and IT have been introduced as elective subjects from grade 9 onwards. It wouldn’t be surprising if further transformative measures are taken even at the elementary education level. Uolo has introduced an innovative 360-degree program for a coding-focused computer science curriculum, known as Tekie, spanning grades 1 to 8. Tekie is a significant stride towards STEM education that aims at making learners future ready—enabling them with skills needed in the ever-changing, technology-driven, and dynamic 21st-century world. Tekie adopts a captivating and engaging approach to learning, in line with the recommendations of the NEP 2020. The curriculum is ingeniously woven into the thrilling adventures of Mel and Conji, fictional characters from the enchanting land of Avora. The Mel and Conji series epitomizes a modern method of acquiring Computer Science knowledge and honing coding skills and computational thinking. Tekie is a technology-empowered curriculum that encompasses a few key components: • • • •
Main Content Books: These introduce learners to the theory of computer science and the tools used in the field. Topics in AI are also covered, along with experiential and curiosity-based learning resources. Coding Book: Specifically designed to nurture coding skills, this booklet aligns with the experiential and contextual learning approach of the curriculum, fostering critical thinking and problem-solving abilities.
Animated Learning Videos: The program is powered by high-quality animation-based learning videos that deliver learning in an engaging manner. Teacher Manual: This valuable resource supports classroom instruction, ensuring that educators can effectively deliver the curriculum.
Welcome to the captivating realm of Tekie! We hope you relish this educational journey as it equips you with the tools you need to thrive in the exciting and ever-changing world of the 21st century.
ii
CS24_ICSE_FM_Grade1.indd 2
11/30/2023 5:34:20 PM
Key Chapter Elements Each chapter has been divided into two key sections. Section A: Story-based Comic In every grade, students embark on an immersive experience in the “Adventures of Mel and Conji”. Within each chapter, in the initial section (Section A), the story unfolds, enveloping learners in an exciting journey. Through the story, students actively connect with fundamental concepts in the realm of Computer Science. Section B: Computer Science Concepts This section of the chapter focuses on the essential academic content. It provides the learning goals and assists teachers in their classroom instruction. This section also includes the following academic assets: QR codes to explore an exciting application of the concept.
HOTS questions to trigger engaging group discussions in the classroom.
Discuss!
This element builds curiosity in children and helps them grasp concepts through digital visual aids.
Is a smartphone like a computer?
Explore More! Interesting facts related to the application of a concept.
Scan this QR code to learn other quick ways to turn off a computer.
Did You Know?
Charles Babbage is known as “the Father of Computers.” This is the chapter summary. It enables learners to glance through all key concepts covered in the chapter.
Probing questions to stimulate HOTS at individual level.
Think and Tell
What are some things you like to do on a computer?
Milestone exercises to practice specific concepts.
A pool of questions catering to all topics and skills covered in the chapter.
iii
Term 2_Main Textbook-2.indb 3
25/01/24 12:28 PM
Introduction to Avora
iv
Term 2_Main Textbook-2.indb 4
25/01/24 12:28 PM
Places in Avora
v
Term 2_Main Textbook-2.indb 5
25/01/24 12:28 PM
Meet the Characters
vi
Term 2_Main Textbook-2.indb 6
25/01/24 12:28 PM
vii
Term 2_Main Textbook-2.indb 7
25/01/24 12:28 PM
Contents
Main Book
1
2
Colouring Drawings ��������������������������������������������������������������������������������������������������������� 1
Colouring a Shape
More Tools in MS Paint
AI—The Robots ���������������������������������������������������������������������������������������������������������������� 17
Introduction to Robots
High-tech Robots in Our World
Block Coding
1
2
Introduction to Coding ��������������������������������������������������������������������������������������������������� 23
Block-based Coding
About Code.org
Command
Sequence
Algorithm
Tour to Puzzle Code Studio
Introduction to Sprite ��������������������������������������������������������������������������������������������������� 37
Sprite Lab
Creating a Scene
Adding Behavior
3
Events and Actions ��������������������������������������������������������������������������������������������������������� 54
4
Loops ������������������������������������������������������������������������������������������������������������������������������� 66
5
Repeat Loop
Debugging ���������������������������������������������������������������������������������������������������������������������� 77
viii
Term 2_Main Textbook-2.indb 8
25/01/24 12:28 PM
1
Term 2_Main Textbook-2.indb 1
25/01/24 12:28 PM
2
Term 2_Main Textbook-2.indb 2
25/01/24 12:28 PM
Chapter 1 • Colouring Drawings
Term 2_Main Textbook-2.indb 3
3
25/01/24 12:28 PM
4
Term 2_Main Textbook-2.indb 4
25/01/24 12:28 PM
Colouring a Shape In the last chapter, we learnt about MS Paint. We drew interesting shapes like squares, circles, and triangles. In this chapter, we will learn how to add colours to our shapes. MS Paint has fantastic tools to make our pictures colourful and exciting.
Did You Know?
Long, long ago, people drew on cave walls using rocks and colours found in nature.
Outline and Fill Options These steps will help us colour the shapes we have drawn. 1. Open your drawing that you had made in MS Paint. house - Paint
Chapter 1 • Colouring Drawings
Term 2_Main Textbook-2.indb 5
5
25/01/24 12:28 PM
2. Go to the Shapes tool.
3. Select a shape of your choice.
4. Click on the Outline option.
5. Choose a colour to outline. The colour you choose will be the colour of the outline of your star shape.
6. Click the Fill option. The colour your choose will be the colour that is filled inside the star shape.
6
Term 2_Main Textbook-2.indb 6
25/01/24 12:28 PM
7. Choose your favourite colour.
8. Fill in the shape by clicking in the area you want coloured. Here, you will click inside the star shape.
Explore More!
Doodle art: Doodle art means drawing without a plan. Find out more about doodle art here!
Discuss!
What shapes would you use to draw the windows, doors, and roof of your house?
Chapter 1 • Colouring Drawings
Term 2_Main Textbook-2.indb 7
7
25/01/24 12:28 PM
Do It Yourself 7A 1
Colour the rainbow with beautiful colours.
More Tools in MS Paint Let us learn about some tools in MS Paint. They help us to draw and make colourful pictures on the computer.
Fill The Fill tool helps us add beautiful colours to our drawings. Let us try to colour the house using this tool!
8
Term 2_Main Textbook-2.indb 8
25/01/24 12:28 PM
Steps to fill the colour in your selected object: 1. Click on the Fill tool and then select the colour of your choice.
2. Colour the windows.
In the same way, colour all the other parts of the drawing you made.
Now, your drawing will be bright and beautiful.
Think and Tell
What did you like the most about MS Paint, and why? Chapter 1 • Colouring Drawings
Term 2_Main Textbook-2.indb 9
9
25/01/24 12:28 PM
Text This tool helps us to put alphabets and numbers in our drawings. Steps to use the Text tool: 1. Click on the Text tool.
2. Then, select any colour from the Colors palette.
3. Click where you want to write and start typing.
Eraser The Eraser tool is used to remove mistakes in our drawings. Steps to use the Eraser tool: 1. Click on the Eraser tool.
10
Term 2_Main Textbook-2.indb 10
25/01/24 12:28 PM
2. Move the mouse pointer to the text which you want to remove.
3. Start erasing the text by moving the tool on the area with your left mouse button pressed.
Color Picker The Color picker tool is a very interesting tool. It allows us to ‘pick’ the colour of an object without going into the colour section.
Color picker Tool
Let us learn to use it. Imagine you want to select the same blue colour that this circle has. 1. Click on the Color picker tool.
2. Take the tool to the same place where the blue colour is.
3. Click on the blue area. You will notice that the blue colour has been selected. Now, you can take the mouse pointer to the area where you want to fill in this colour and click to fill the same selected colour.
Chapter 1 • Colouring Drawings
Term 2_Main Textbook-2.indb 11
11
25/01/24 12:28 PM
Brushes Brushes help you make different lines, shapes, and textures, just like real paint brushes. 1. Click on the Brushes tool.
2. Select the option that you want to use.
Do It Yourself 7B 1
Write T for True and F for False. a
We use the Fill tool to correct our mistakes while drawing.
b
We use the Text tool to insert numbers and alphabets in our drawings.
c
Imagine you have a pink figure. If you want to draw a circle of the same pink colour, you can use the Color picker tool.
d
The Brushes tool can only draw bold strokes, not thin strokes.
12
Term 2_Main Textbook-2.indb 12
25/01/24 12:28 PM
Points to Remember 1
In MS Paint, we can colour shapes to make them beautiful.
2
We can use the ‘Outline’ and ‘Fill’ options to add colours.
3
With the Color picker tool, we can choose a particular colour for drawing.
4
In MS Paint, we can fix mistakes with the ‘Eraser’ tool.
5
Brushes help us to draw in thick and thin strokes.
6
The ‘Text’ tool allows us to write words.
Chapter Checkup A. Fill in the Blanks. Hints:
Color picker
Eraser
Text
Outline
1
The thinner.
option helps us pick the outline colour and make it thicker or
2
The
tool in MS Paint lets us pick any colour for our paint brush.
3
When we want to fix mistakes in our drawing, we use the
4
The pictures.
tool.
tool works like a special pen that lets us write words on our
B. Tick () the Correct Option. 1
What tool do we use in MS Paint to select shapes for colour? a
2
3
b
c
d
How do ‘Brushes’ in MS Paint help us? a
Choose outline colours
b
Remove mistakes from the drawing
c
Draw with different line styles
d
Fill shapes with colours
What does the ‘Fill’ option in MS Paint do? a
Allows us to choose the outline colour b Fills the shape with a colour
c
Removes mistakes from the drawing
Chapter 1 • Colouring Drawings
Term 2_Main Textbook-2.indb 13
d
Selects the shape for colouring
13
25/01/24 12:28 PM
4
Which tool is used to pick a colour for the paint brush? a
5
b
c
d
What is the use of the ‘Eraser’ tool in MS Paint? a
Adds colours to shapes
b
Removes mistakes from the drawing
c
Writes words on the picture
d
Draws different styles of lines
C. Who Am I? 1
I let you select the shapes.
2
I allow you to fill a shape with your chosen colour.
3
I let you write “Kite” in your picture.
4
I allow you to pick any colour you like for your paint brush.
5
I help you remove mistakes from your drawing.
D. Write T for True and F for False. 1
In MS Paint, we can add colours to our shapes using the ‘Fill’ option.
2
We can open a saved drawing in MS Paint.
3
The ‘Select’ tool is used to remove mistakes from the drawing in MS Paint.
4
We cannot erase our mistakes in MS Paint.
5
The ‘Text’ tool in MS Paint functions like a special pen to draw different styles of lines.
E. Answer the Following. 1
What do we use to make our shapes colourful in MS Paint?
2
What tool do we use to fix a mistake in our drawing?
14
Term 2_Main Textbook-2.indb 14
25/01/24 12:28 PM
3
What is the use of Color picker tool?
4
What can we do with the ‘Text’ tool in MS Paint?
5
Why do we need to colour our drawings?
F. Apply Your Learning. 1
You want to colour a picture of a cute puppy. Which MS Paint tool can you use to add colours to the picture of the puppy?
2
Sahiba drew a beautiful flower but made a mistake in one petal. Which MS Paint tool can help her fix the mistake?
3
Simran drew a happy sun and wanted to add some text to make it say “Hello!”. Which MS Paint tool allows her to write words on her picture?
4
Nikhil drew an apple using MS Paint. Now he is drawing cherries. He wants to make the cherries of the same red colour as that of the apple. How can he do that?
Chapter 1 • Colouring Drawings
Term 2_Main Textbook-2.indb 15
15
25/01/24 12:28 PM
16
Term 2_Main Textbook-2.indb 16
25/01/24 12:28 PM
17
Term 2_Main Textbook-2.indb 17
25/01/24 12:28 PM
Introduction to Robots All of us love going to toy stores. Playing with toys is so much fun. We see many toys around us, like teddy bears, rabbits, and dolls. But what is this toy that looks like a person? It can also walk on its own! This is a robot. But, what are robots? A robot is a machine that can do things on its own. Some robots can move around and some can even pick things up. We even have robots that look like humans and can talk as well!
Discuss!
Is a torch a robot?
How Do Robots Work? We know that robots can do things on their own. But how do they do that? They can do all these smart things using AI, which stands for Artificial Intelligence. With AI, machines are made to act like they understand and think. AI also helps machines to learn things. So, when you talk to your ‘smart’ robot, the AI helps the robot to understand you. It also helps the robot to reply.
18
Term 2_Main Textbook-2.indb 18
25/01/24 12:28 PM
High-tech Robots in Our World There are many robots in the world that scientists have invented. Sparko Sparko, the first robotic dog, was developed in the USA in the 1940s. It can: • walk and run. • wag its tail like a real dog. • play games. • listen to us. • bark like a real dog.
Did You Know?
The first programmable robot, Unimate, was developed by George Devol and Joseph Engelberger in the 1950s.
Roomba Roomba is a robotic vacuum cleaner. It was developed in the USA in 2002. It can: • roam around the house on its own. • move without hitting a person. • clean the house on its own. Sophia Sophia is the first human-like robot. It was developed in Hong Kong in 2016. It can:
• teach you different things. • play games with you as a friend. • dance with you. • talk to you. Chapter 2 • AI—The Robots
Term 2_Main Textbook-2.indb 19
Explore More!
Check out some new-age robots here! 19
25/01/24 12:28 PM
Points to Remember 1
A robot is a machine that can do things on its own.
2
With AI, machines are made to act like they understand and think.
3
A ‘smart’ robot can move around like us and talk to us.
4
The name of the world’s first robotic dog is Sparko.
5
Human-like robots act like us.
Chapter Checkup A. Fill in the Blanks. 1
A
R
I
F
2
I
N
E
L
3
R
B
T
4
S
A
T
5
M
C
H
C L
L G
N
C
E
N
B. Who Am I? 1
I help robots think.
2
I can bark even though I am not a real dog.
3
I am the first human-like robot.
C. Write T for True and F for False. 1
With AI, machines are made to act like they understand and think.
2
Sparko is the first human-like robot.
3
Roomba is a robot that can dance with you.
20
Term 2_Main Textbook-2.indb 20
25/01/24 12:28 PM
Block Coding
Term 2_Main Textbook-2.indb 21
25/01/24 12:28 PM
Term 2_Main Textbook-2.indb 22
25/01/24 12:28 PM
1
Introduction to Coding
Can you understand the words in the talk bubbles in the given picture?
Can you understand the words in the talk bubbles in this picture too?
No!
Yes!
This is because you may not know all these languages.
This means you know English.
We must know the same language to talk to each other. You would have seen this machine. This is a computer.
It can help us do a lot of things.
We can draw pictures, play games, watch films, and more. To make a computer let us do these things, we need to learn how to talk to it.
Computers cannot understand our words like people do.
We have to learn their language. That is what coding is. Coding language is used to talk to a computer. The coding language that we will learn is called Block-based Coding. 23
Term 2_Main Textbook-2.indb 23
25/01/24 12:28 PM
Block-based Coding
Block-based coding is a way to tell a computer what to do by joining colourful blocks together.
Did You Know?
Let us learn about the platform that we will use to code and have fun.
Just like we join lego blocks, we can place a code block on top of another.
About Code.org
Code.org is a fun coding platform where you can learn to use colourful blocks to make characters move, play games, and even tell stories.
It is a place where you can grow your coding skills and create amazing things using your imagination.
</>
C
O
D
E
Before we learn to use this platform, let us learn about commands.
Command
Look at the given picture.
Jump!
What is the instruction here?
You are correct! The instruction is to jump. For computers, an instruction is called a command. A command is an instruction that tells a computer what to do.
Discuss
What instructions can you give to your pet?
In block-based programming, we use code blocks to give commands to a computer. Block to make a character move up
Did You Know? In block-based coding, the blocks can be of different colours, like crayons.
24
Term 2_Main Textbook-2.indb 24
25/01/24 12:28 PM
Sequence
We all follow a routine in our daily lives.
The pictures below show the steps to get ready for school in an order.
1 Wake up
2 Brush your teeth
3 Take a bath
4 Wear your uniform
5 Have your breakfast
6 Ready for School
Just like this, we do a lot of tasks in our daily lives. A task is a piece of work that needs to be done. It can be as simple as brushing our teeth or as fun as playing with our toys. We follow a particular sequence to do a task.
A sequence is when we do things step by step in an order.
Chapter 1 • Introduction to Coding
Term 2_Main Textbook-2.indb 25
25
25/01/24 12:28 PM
Let us say we need to help the harvester pick the corn. What do you think? How many ways can we make the harvester pick the corn? We can make the harvester pick the corn in many ways.
3 1 2
Flexible Sequence
As there is more than one way. This means we may have one way or many ways to do a task. A sequence can be a: Fixed sequence
Flexible sequence
:
There is only one way to do the task.
: There can be more than one way to do the task.
Let us take another example.
Observe the given picture and find out what type of sequence is this.
Discuss
Making your bed! Is it a fixed sequence or a flexible sequence?
26
Term 2_Main Textbook-2.indb 26
25/01/24 12:28 PM
There is only one way to make the harvester pick the corn. So this is a fixed sequence.
Fixed Sequence
As there is only one way to pick corn.
Do It Yourself 1A Tick the correct options for the missing steps in the pictures given below.
?? ?
1
Fill Pot Fill Hole Put PutSeed Seed FillPot Pot Poke Poke Hole With Soil with Soil Put inHole Hole In WithSoil Soil In Soil Seed Fill Pot Poke in Hole In Hole With Soil In Soil
2
Paste on Paste On Brush Brush
Poke Hole Poke Hole Poke Hole inIn Soil Soil In Soil Chapter 1 • Introduction to Coding
Term 2_Main Textbook-2.indb 27
Water Pot Put Pot In Pot in Water Pot Put Put Pot In Sunlight Sunlight WaterSunlight Pot Put Pot In Sunlight
With Soil
Teeth
?
Put Seed
Water In Hole Pot
Cover Seed Cover Seed Cover Seed Cover Seed with Soil With Soil With Soil
Brush Brush Brush Teeth Teeth
Brush Teeth
Poke Hole In Soil
Brush Brush Teeth Teeth
Poke Hole In Soil Dirty
Teeth
Dirty Dirty Teeth Teeth
Water Pot
Water PotWater Pot Water Pot
Clean Clean Teeth Teeth
Dirty Teeth Put Foot
In Shoe
Put Foot Put Foot in Shoe
Put Foot In Shoe In Shoe
27
25/01/24 12:28 PM
Algorithm
A problem is like a puzzle that needs to be solved. There can be more than one way to solve a problem. Each way has some steps to be followed to solve it. The set of steps in an order to solve a problem is called an Algorithm. In the example given in the previous section, getting ready for school is the problem.
The steps given in order are the solution for this.
Think and Tell Can we have more than one way to solve a problem?
Did You Know?
Some algorithms have fun names, like Hummingbird, Bat, Firefly, and Grey Wolf. You can give your algorithm a name too.
Sometimes problems can be too big to solve.
But we can break them down into smaller ones to solve them easily. Let us talk about making a sandwich.
Making a sandwich may seem like a big problem. But we can solve it easily by breaking it into smaller steps, like gathering all the things we need for the sandwich like bread slices and cheese, and cutting veggies.
When we are ready with all that we need, we can follow the given steps to make a sandwich. 1
Take two slices of bread.
2
Put cheese on a slice.
3
Add some toppings.
4
Put the other slice on the top and the sandwich is ready.
Similar to how we solved the problem of making a sandwich, we can solve many problems in coding by putting the code blocks in a sequence. Now, look at the given picture. We need to help the bird reach the pig. 28
Term 2_Main Textbook-2.indb 28
25/01/24 12:28 PM
We can do this by putting code blocks on top of each other in an order. Let us see how we can make the bird reach the pig.
The W block will make the bird move one step left.
We need to give two W blocks to make the bird move in the left direction. The S block will make the bird move one step down.
These blocks are called direction blocks as they are named after the four main directions: North, South, East, and West.
Think and Tell If we put the blocks in a different order, will the bird do something else? Chapter 1 • Introduction to Coding
Term 2_Main Textbook-2.indb 29
29
25/01/24 12:28 PM
Do It Yourself 1B 1 Think of the story of Little Red Riding Hood. Then, number the given pictures in the correct sequence.
2 Tick () the correct sequences. a.
a
a.
b
a. b.
b.
b.c.
c.
c
Tour to Puzzle Code Studio c.
The Puzzle Code Studio on Code.org is the playground where we code to solve the given puzzles. There are four important parts:
Instructions
Play Area
Toolbox
Workspace
30
Term 2_Main Textbook-2.indb 30
25/01/24 12:28 PM
Play Area Toolbox
: The area where we can see things happening. : The area that holds all the code blocks which we can use to give commands. Workspace : The area where we can drag and attach the blocks together to make things happen. Instructions : The hints that help us know what to do next. Scan the QR Code to open the activity.
Coding Challenge
Code to help the harvester get all the corns.
Chapter 1 • Introduction to Coding
Term 2_Main Textbook-2.indb 31
31
25/01/24 12:28 PM
Chapter Checkup A Fill in the Blanks. coding
Hints
play area
sequence
command
flexible
is the language used to talk to a computer.
1 2
We can give a
to a computer to do a task.
3
A
4
In a
sequence, we can do a task in more than one way.
5
The
is the area where we can see things happening.
is when we do things step-by-step in an order.
B Tick () the Correct Option. 1
Which of the following statements is True?
a In block-based coding, a code block is a command. b Coding lets us talk to computers. c We can use coding to talk to people. d We can command our pets using coding. 2
The set of steps in order to solve a problem is called a/an
a
Sequence
b
Command
c
Algorithm
d
All of these
3
.
Identify the section shown in the given picture. a
Toolbox
b
Workspace
c
Play Area
d
Instruction
32
Term 2_Main Textbook-2.indb 32
25/01/24 12:28 PM
Which block can help us move a character up?
4
a
b
c
d
Which of the following codes will make the bird reach the pig?
5
a
C
All of these
b
c
d
Who Am I? What I Do?
Who Am I?
Move the character downward
Sequence
Move the character to the right
Coding
An ordered group of commands A coloured picture that tells the computer what to do A language that helps you talk to a computer D
Code block
Write T for True and F for False. 1
Using coding, we cannot talk to a computer.
2
A sequence is an instruction.
3
There is a sequence to everything happening around us.
4
In a fixed sequence, we can do the task in more than one way.
5
The toolbox has all the blocks we need for coding.
Chapter 1 • Introduction to Coding
Term 2_Main Textbook-2.indb 33
33
25/01/24 12:28 PM
E
Answer the Following. 1
What is a command?
2
What are the types of sequences?
3
Number the pictures in the correct order.
4
Label the parts of the screen. 3
4
1
2
34
Term 2_Main Textbook-2.indb 34
25/01/24 12:28 PM
5
Find out where the cat will reach if it follows the given commands.
F
Apply Your Learning. Write down the commands in the given spaces to help the squirrel reach the nut. Just like the one you see here.
when run W W ` 1
when run
2
Chapter 1 • Introduction to Coding
Term 2_Main Textbook-2.indb 35
when run
35
25/01/24 12:28 PM
3
when run
Write down the commands for two ways to make the squirrel reach the nuts. 4
5
when run
when run
when run
when run
36
Term 2_Main Textbook-2.indb 36
25/01/24 12:28 PM
2
Introduction to Sprite
We all enjoy listening to stories. But do you know how stories are created? A story is made up of various elements, such as: 1. Characters 2. Problem 3. Setting 4. Events
: People, animals, or things in the story : Something that needs to be done or solved : The place where the story happens : When and what happens
We can use block-based coding to make stories. Let us make a story about an astronaut going on a space adventure. An astronaut is a person who travels in space to do experiments and explore space.
But before we begin, we should find out the elements of our story.
Who will be the main character in the story?
Correct! The astronaut will be the main character in our story. A character in coding is called a Sprite. So, the astronaut will be the main sprite in the story.
Now, what does an astronaut need to travel in space? Yes! An astronaut needs a rocket to travel.
37
Term 2_Main Textbook-2.indb 37
25/01/24 12:28 PM
In coding, any other character or thing in the story is also called a sprite. So the rocket will be another sprite in our story. Where should the journey of the astronaut begin? From the Earth, Right!
And where is the astronaut travelling to? Mars, the red planet!
Do It Yourself 2A 1 Name the characters in the given picture from the story Hansel and Gretel.
2 Write down the number of sprites shown in the given pictures. a
b
c
Sprite Lab
Now, let us learn about the tool from code.org that we will use to make our story project. It is called Sprite Lab.
A Sprite Lab is where we can create our own stories and games. 38
Term 2_Main Textbook-2.indb 38
25/01/24 12:28 PM
The Sprite Lab has three parts:
1. Play Area 2. Toolbox 3. Workspace
: The area where we can see things happening. : The area that holds all the code blocks and which we can use to give commands. : The area where we can drag and attach the blocks together to make things happen.
Creating a Scene
It is time to make scenes for the exciting journey of the astronaut in Sprite Lab.
We will have two scenes: one for the start of the story and another for reaching Mars. Let us begin with the first scene. Who will be the characters?
Characters: Sprites
Chapter 2 • Introduction to Sprite
Term 2_Main Textbook-2.indb 39
Where will the scene happen?
Setting: Background 39
25/01/24 12:28 PM
Now, let us find the steps to create the first scene in the Sprite Lab. Algorithm to setup the first scene
1
Set the background to a park.
2
Add the astronaut sprite.
3
Set the size of the astronaut sprite.
4
Add the rocket as the second sprite.
5
Set the size of the rocket sprite.
Now, let us follow the algorithm to code the first scene. Steps to code the first scene: 1
Set the background to a park. a
Go to the World section.
c
Set the background.
b
1. Drag the set background to block. 2. Drop it under the when run code block in Workspace.
Find the “set background to“ block.
d
Select the background. 1. Click the drop-down button. 2. Select Backgrounds.
40
Term 2_Main Textbook-2.indb 40
25/01/24 12:28 PM
e
Add the park background. 1. Click the plus sign.
2. Scroll down to choose the park background. 3. Click the Done button.
2
Add the astronaut sprite. a
Go to the Sprites section.
b
Find the “make new sprite at” code block. lick and drag the make new sprite at C code block.
Chapter 2 • Introduction to Sprite
Term 2_Main Textbook-2.indb 41
41
25/01/24 12:28 PM
c
Open Costumes. 1. Click the drop-down button in the make new sprite at code block. 2. Click the Costumes button to add the astronaut sprite to your library.
Click Costumes
d
Add a new costume. Click the New Costume.
e
Open Space Costumes Library.
f
Select the astronaut sprite. 1. Select the astronaut sprite.
2. Click the Done button.
42
Term 2_Main Textbook-2.indb 42
25/01/24 12:28 PM
g
h
Move to the Code window. 1. Click the Code tab.
i
Select the sprite. 1. Click the astronaut sprite.
Position the astronaut. 1. Click the location icon to change the position of the astronaut.
2. Move cursor in the Play Area.
3. Click where you want to place the astronaut.
3
Set the size of the astronaut sprite. a
Go to the Sprites section.
b
Find the “set size to“ code block. 1. Go to the Sprites section in Toolbox.
2. Click and drag the set size to code block.
Chapter 2 • Introduction to Sprite
Term 2_Main Textbook-2.indb 43
43
25/01/24 12:28 PM
c Set the size of the astronaut sprite. 1. Click the drop-down in the set size to block.
2. Select the astronaut sprite.
3. Change the value of size to 100.
4
Add the rocket sprite.
a Get another “make new sprite at“ code block. 1. Go to the Sprites section in the Toolbox.
2. Click and drag the make new sprite at code block.
b
Add rocket sprite. 1. Click the drop-down in the make new sprite at code block.
2. Select rocket from the list of sprites. Place the rocket where you want it.
5
a
c
Find the “set size to“ code block. 1. Go to the Sprites section in the Toolbox.
2. Click and drag the set size to code block.
Set the size of the rocket sprite. 1. Click the drop-down and select rocket sprite.
2. Change the value of the size to 200.
44
Term 2_Main Textbook-2.indb 44
25/01/24 12:28 PM
Our first scene setup is done.
Now, we will add the moving behaviour of the astronaut.
Adding Behavior Adding Behavior means telling our sprites what to do when we press the Run button. Here, we need to make our astronaut sprite move to the right to reach the rocket. 1
2
Find the “sprite begins“ code block. Go to the Behaviors section in the Toolbox.
Set the “sprite begins“ code block. 1. Drag the sprite begins code block. 2. Attach it below the size block of the rocket sprite. 3. Select the astronaut sprite.
3
Find the “moving east“ code block. 1. Go to the Behaviors section. 2. Scroll down and look for the moving east code block.
Chapter 2 • Introduction to Sprite
Term 2_Main Textbook-2.indb 45
4
Attach the “moving east“ code block. Drag the moving east code block next to begins.
45
25/01/24 12:28 PM
Try Your Code
Think and Tell
Click the Run button in the Play Area.
How can we make the sprite go left?
Chapter Checkup A
Fill in the Blanks. location
Hints
sprite
1
There are
2
A character in coding is known as a
four
. of a sprite to place it anywhere in the Play
Area.
You can change the
of a sprite to make it big or small.
5 You can add and control the
B
size
main elements that make up a story.
3 You can change the 4
behavior
of a sprite.
Tick () the Correct Option. 1
How many sprites are there in the picture given below?
a
1
b
2
c
0
d
3
46
Term 2_Main Textbook-2.indb 46
25/01/24 12:28 PM
2
Which block can be used to change the costume of a sprite?
a
b
c
d
3
Sprites can be created with the help of which block?
a
b
c
d
4
Which block can change the size of a sprite?
a b
Chapter 2 • Introduction to Sprite
Term 2_Main Textbook-2.indb 47
47
25/01/24 12:28 PM
c
d 5
Choose the correct sequence of how we set up the first scene.
C
Who Am I? Identify and name the highlighted parts in the given pictures.
48
Term 2_Main Textbook-2.indb 48
25/01/24 12:28 PM
D
E
Write T for True and F for False. 1
We need to set the location of a sprite before we make it.
2
You can change the outfit of a sprite.
3
Sprites can touch each other.
4
You cannot add multiple sprites to a scene.
5
You cannot change the size of a sprite.
Answer the Following. 1
What is a sprite?
2
What does this button do?
Chapter 2 • Introduction to Sprite
Term 2_Main Textbook-2.indb 49
49
25/01/24 12:28 PM
3
Which of the following options will show this sprite in the Play Area?
a
b
4
Which of the following options will be shown for the given code?
50
Term 2_Main Textbook-2.indb 50
25/01/24 12:28 PM
a
5
b
To what side will the sprite move with the given code?
a F
Left
b
Right
Apply Your Learning. 1
Name the blocks in the given space to see this in the Play Area.
Chapter 2 • Introduction to Sprite
Term 2_Main Textbook-2.indb 51
51
25/01/24 12:28 PM
2
Observe the Play Area.
Name the missing block in the given code.
3
Name the missing part in the set block to get the change shown in the purple rabbit.
52
Term 2_Main Textbook-2.indb 52
25/01/24 12:28 PM
4
What will the given code do to the purple rabbit?
a
b
c
Chapter 2 • Introduction to Sprite
Term 2_Main Textbook-2.indb 53
53
25/01/24 12:28 PM
31
Events and Actions
What happens when someone tickles you? You laugh. Right?
Here, tickling is an event and laughing is an action.
An event tells you when an action will happen. What will you do when you are hungry?
Event
Action
You will eat food. Right?
Here, being hungry is an event and eating food is an action.
Think and Tell Are mouse clicks and keypress events too?
54
Term 2_Main Textbook-2.indb 54
25/01/24 12:28 PM
Events are important in coding too!
In a car game, we can make the car go left or right, using arrows. Clicking the arrows is the event.
The car moving to the left or right is the action that happens! Now it is time to complete our astronaut story.
Do you remember what the astronaut wants?
The astronaut wants to go to the planet Mars for space exploration.
We had set up our first scene in the previous chapter.
Now, we need to add code for the second scene.
The second scene is where the astronaut will reach the planet Mars. When will the astronaut reach the planet Mars?
The astronaut will reach the planet Mars when it touches the rocket.
Discuss
What events and actions happen around us every day?
Here, touching the rocket is the event.
The astronaut reaching the planet Mars is the action. Chapter 3 • Events and Actions
Term 2_Main Textbook-2.indb 55
55
25/01/24 12:28 PM
Event
When astronaut touches the rocket
Action
1. Change the costume of the astronaut 2. Stop moving the astronaut
We can even change the costume of the astronaut into another to show the victory. A costume sets the appearance of a sprite.
Do It Yourself 3A 1 Match the correct event and action pairs.
Events
Action
a
1
b
2
c
3
d
4
56
Term 2_Main Textbook-2.indb 56
25/01/24 12:28 PM
Setting up the Second Scene
Let us define the event to set up the second scene.
1 Set the event—when the astronaut touches the rocket. a
Go to Events.
b
Find the “when touches” block.
c
Add it to Workspace. Drag and drop the when touches event block below the code we made last time.
Chapter 3 • Events and Actions
Term 2_Main Textbook-2.indb 57
d
Change the sprites. 1. Change the rabbit sprite to the astronaut. 2. Change the carrot sprite to the rocket.
57
25/01/24 12:28 PM
2
Change the costume of the sprite. a
Find the “change costume to“ block. 1. Go to the Sprites section. 2. Scroll down to find the change costume to block.
c
Attach it to the “when touches” block.
b
Drag and drop it below the when touches block.
Set the costume. 1. Change the purple rabbit to the first costume of the astronaut. 2. Change the brown rabbit to the second costume of the astronaut.
3 Stop moving the astronaut when it touches the rocket. a
Add the “sprite stops” code block. 1. Go to Behaviors. 2. Drag the sprite stops block.
b
Find the “moving east” block. 1. Scroll down and look for moving east block.
3. Drop it below the change costume to block.
c
Set the “moving east” block. Drag and drop it to the stops section of the sprite stops block.
58
Term 2_Main Textbook-2.indb 58
25/01/24 12:28 PM
Try Your Code
Click the Run button in the Play Area.
Chapter Checkup A
Fill in the Blanks. Hints
when touches
1
Clicking the Run button to try the game is an
2
Laughing is an
3 The
bump into each other.
B
change costume
4
A
5
The
costume
action
event
.
for the tickling event. block is used to add the event for sprites when sprites sets the appearance of a sprite. block will change the costume of a sprite.
Tick () the Correct Option. 1
Which of the following statements is true about Events and Actions?
a An event tells you when an action will happen. b An action tells you when an event will happen. Chapter 3 • Events and Actions
Term 2_Main Textbook-2.indb 59
59
25/01/24 12:28 PM
c Both actions and events will happen at the same time. d Actions and events are both independent. 2
Choose the correct action for the given event.
a
b
c
Event
d
3 If you press the ON button on the TV remote, what will be the action of this event?
a Your TV will turn on. b Your TV will not turn on. c It will change the channel. d It will increase the volume. 4
When will the astronaut change his costume?
a 5
b
c
d
When will the background change in the story?
a At the start b At anytime c Not at all d When the astronaut touches the rocket
60
Term 2_Main Textbook-2.indb 60
25/01/24 12:28 PM
C
Match the Following. Column A
Column B
Stop Moving Right
Event
Right
Action
sprite begins
D
moving east edit
Write T for True and F for False. 1
An event always comes after an action.
2
You cannot change the behaviour of a sprite.
3
The ringing of a doorbell is an action.
4
Opening the door when a doorbell rings is an example of an action.
5
The “moving east” block stops the behaviour of a sprite.
Chapter 3 • Events and Actions
Term 2_Main Textbook-2.indb 61
61
25/01/24 12:28 PM
E
Answer the Following. 1
What is an event?
2
What is an action?
3
What will happen if you use this block?
a
4
b
What will you see in the Play Area if you run the given code?
62
Term 2_Main Textbook-2.indb 62
25/01/24 12:28 PM
a
5
b
What will happen if you run the given code?
a
b
Chapter 3 • Events and Actions
Term 2_Main Textbook-2.indb 63
63
25/01/24 12:28 PM
F
Apply Your Learning. 1
Observe the code and the Play Area.
Circle the missing sprite in the given code.
2
Observe the given code.
Identify and circle the missing sprite in the given sprites.
64
Term 2_Main Textbook-2.indb 64
25/01/24 12:28 PM
3
Name the missing part of the given code.
4
Write down E for event and A for action in the given boxes. The teacher enters the classroom. Students say, “Good morning teacher!”. Good morning teacher!
5
Look at the following pictures and name them as Events or Actions.
Chapter 3 • Events and Actions
Term 2_Main Textbook-2.indb 65
65
25/01/24 12:28 PM
41
Loops
In our daily lives, we do many activities.
Imagine that there are pieces of paper spread everywhere in your room. Your mother wants you to clean them up. What if she tells you to do this for every piece?
She would have to say the same thing many times. But would it not be better if she said it just once?
In the same way, we can use a loop to tell a computer to repeat a command. A loop is an action of doing something, again and again, until the task is complete. In real life, while doing something, we know when to stop.
In the same way, we should know when to stop a task in coding as well. In a loop, we need to know two things: 1 2
What to do?
When to stop?
Imagine we need to put five pieces of paper in the dustbin. Here, what we need to know is: • What to do—pick a piece of paper and put it in the dustbin. • When to stop—when all the five pieces are in the dustbin.
66
Term 2_Main Textbook-2.indb 66
25/01/24 12:28 PM
one
two
three
four
five
Repeat Loop
In coding, we can repeat a task a number of times using the repeat code block. Let us see what can be the code for putting five pieces of paper in the dustbin.
Did You Know? The repetition of words is a common way used in poetry.
The repeat loop is used when we want to repeat a task a certain number of times. By using the repeat loop, our code has become shorter. Remember the astronaut project?
We made the astronaut change its costume when it touched the rocket. Next, we need to change the background on the same event. Then, we can add a twist to it using the repeat block. Imagine the astronaut reaching the planet Mars. People on Mars gather to see the astronaut. Chapter 4 • Loops
Term 2_Main Textbook-2.indb 67
67
25/01/24 12:28 PM
Let us get started. 1
Change the background when the astronaut touches the rocket. a
Open your project.
b
Find the “set background to” block. 1. Go to the World section.
2. Click and drag the set background to block in the Workspace.
c
Add the “set background” block. Join the set background block below the sprite stops block.
68
Term 2_Main Textbook-2.indb 68
25/01/24 12:28 PM
d
Change the background to Mars. 1. Click the drop-down button.
2. Click the Backgrounds button to add the Mars background.
e
Add new background. Click New Background to add Mars background to your library.
f
Choose the Mars background. Choose the Mars background and click the Done button.
Chapter 4 • Loops
Term 2_Main Textbook-2.indb 69
69
25/01/24 12:28 PM
The background gets added to your library.
Click the Code tab to set the Mars background. g
Set the background. 1. Click the drop-down button.
2. Select the Mars background.
2
Add Mars people at random locations.
a
Add repeat block. 1. Go to the Loops section.
2. Click and drag the repeat block in the Workspace.
b
Set the number of times for the repeat block. 1. Join the repeat block below the set background to block.
2. Change the value of number of times to 5.
70
Term 2_Main Textbook-2.indb 70
25/01/24 12:29 PM
c
Make the Mars people sprite.
d Make the Mars people sprite.
1. Go to the Sprites section.
2. Drag and attach the make new sprite at block inside the repeat block.
e Remove the default location block.
f
Place the green sprite at a random location. 1. Go to the Locations section.
2. Click and drag the random location block.
Attach it to the make new sprite at code block.
This will make five green sprites and make them appear at random locations. A random location is not a fixed place. It is like a surprise place that can be anywhere in an area. Our project is complete.
If you want, you can change the size of the green sprites using the set size code block.
Chapter 4 • Loops
Term 2_Main Textbook-2.indb 71
71
25/01/24 12:29 PM
Do It Yourself 4A Look at the given picture.
Which of the following codes will make the mouse reach the cheese? 1
2
3
4
Chapter Checkup A
Fill in the Blanks. Hints 1 A
complete.
shorter
random
loop
stop
certain
is an action of doing something, again and again, until the task is
2 In a loop, we need to know when to
.
72
Term 2_Main Textbook-2.indb 72
25/01/24 12:29 PM
3 The repeat loop is used when we want to repeat a task a
times.
4 Using a repeat loop, your code will become 5 A
B
number of
.
location is not a fixed place.
Tick () the Correct Option. 1
Which block is used to do a task a certain number of times?
a c
2
b
d
Which code will show the given picture in the Play Area?
a
b
3
Which is the correct picture of the Play Area for the given code?
Chapter 4 • Loops
Term 2_Main Textbook-2.indb 73
73
25/01/24 12:29 PM
4
Which option makes the germ sprites appear, as shown in the given picture?
a
C
b
Who Am I? What I Do?
Who Am I?
I can set or change the background as you want. I can do a task, again and again, for a certain number of times. I can place a sprite anywhere in the Play Area.
74
Term 2_Main Textbook-2.indb 74
25/01/24 12:29 PM
D
Write T for True and F for False. 1
When the following code runs, it will show the given picture in the Play Area.
2
The Play Area shows the given picture when the given code runs.
E
Answer the Following. 1
How can you make your code shorter?
2
What is a loop?
3
Which of the following are real-life examples of a loop?
Chapter 4 • Loops
Term 2_Main Textbook-2.indb 75
75
25/01/24 12:29 PM
4
F
Why is reading a book not an example of loops?
Apply Your Learning. Observe the given pictures.
Then, write down the number of times the sprites need to repeat the task to complete it. 1
2
3
4
76
Term 2_Main Textbook-2.indb 76
25/01/24 12:29 PM
5
Debugging
Remember when you started learning to ride a bicycle for the very first time? You might have fallen a few times, right?
In the same way, learning coding can be a little tough. In the beginning, the code may not be perfect. You may need to try many times before you get it just right. Sometimes there are tiny mistakes in the code.
The mistakes in the code are called bugs. Finding and fixing these bugs is called debugging.
77
Term 2_Main Textbook-2.indb 77
25/01/24 12:29 PM
Let us try to find the bugs in the given sequence of commands.
Then, write the correct sequence of commands to make the smiley reach the pumpkin. RT
STA
Let us try another example.
The crab should appear at a different place each time the code is run.
However, the given code is not doing so. Find and circle the bug in the code.
Discuss
Why is it important to find and fix errors in computer programs?
It is good to check your code often.
This helps you find mistakes early and fix them before they get big. 78
Term 2_Main Textbook-2.indb 78
25/01/24 12:29 PM
Do It Yourself 5A 1 Look at the given picture.
What is wrong with the code?
2 When we run the code, it should show the chimpanzee as big as in the given picture. Find out the bug in the code. Fix it by numbering the blocks in the correct sequence.
Chapter 5 • Debugging
Term 2_Main Textbook-2.indb 79
79
25/01/24 12:29 PM
Chapter Checkup A
Fill in the Blanks. Hints
check
bugs
are the mistakes in the code.
1
B
debugging
2
Finding and fixing the bugs is called
3
It is good to
.
your code often and fix the bugs.
Tick () the Correct Option. 1
Which of these is NOT a part of debugging?
a Finding 2
Fixing
b
c
Placing
Find the correct sequence of steps that will make the bear reach its den. Start
End
a
b
c
d
80
Term 2_Main Textbook-2.indb 80
25/01/24 12:29 PM
What will this code show in the Play Area?
3
a
A
4
b
in a code can cause it to not work.
a bug
b
c
fault
What should you do with a bug?
5
a Fix it C
problem
b
Keep it
Who Am I? What I Do?
Who Am I?
I do not let your code work. I do a task again and again.
Bug
I do a task a certain number of times.
Loop
Chapter 5 • Debugging
Term 2_Main Textbook-2.indb 81
81
25/01/24 12:29 PM
D
E
Write T for True and F for False. 1
I am bug in the code.
2
Finding and fixing the mistakes is called debugging.
3
A mistake in the code is a bug.
4
Debugging is finding and keeping the mistakes in the code.
Answer the Following. 1
Circle the odd one out.
a
b
2
This picture shows what the Play Area looks like when the code runs.
Find if there is any mistake in the code. If yes, then circle it.
82
Term 2_Main Textbook-2.indb 82
25/01/24 12:29 PM
F
Apply Your Learning. 1
Observe the picture and find out what is wrong with the code?
2
Observe the code and then the picture.
Name the missing item in the given picture.
Chapter 5 • Debugging
Term 2_Main Textbook-2.indb 83
83
25/01/24 12:29 PM
3
Observe the picture and the code. Then, circle the mistake in the code.
4
Number the blocks in the correct order to fix the code.
84
Term 2_Main Textbook-2.indb 84
25/01/24 12:29 PM
Computer Science
About the Book This book embodies the principles outlined in the National Education Policy (NEP) 2020. It unveils the world of computer science through a unique and captivating pedagogical approach—seamlessly integrating curriculum content into the mesmerizing adventures of Mel and Conji, fictional figures hailing from the enchanting world of Avora. Our aim is to prepare learners for the dynamic and technology-driven landscape of the 21st century, equipping them with the essential skills they need to thrive in an ever-evolving world.
(TERM II)
Special Features • Explore More: QR codes to explore an exciting application of the concept. This element builds curiosity in children and helps them grasp concepts through digital visual aids. 2
• Discuss: Questions to trigger engaging group discussions in the classroom. • Think and Tell: Probing questions to stimulate thinking at an individual level. • Did You Know? Interesting facts related to the application of a concept. • Points to Remember: Chapter end summary. • Do It Yourself: Milestone exercises to practice specific concepts. • Chapter Checkup: A pool of questions catering to all topics and skills covered in the chapter.
About Uolo Uolo partners with K-12 schools to bring technology-based learning programs. We believe pedagogy and technology must come together to deliver scalable learning experiences that generate measurable outcomes. Uolo is trusted by over 10,000 schools across India, South East Asia, and the Middle East.
Singapore
|
Gurugram
CS_CB_Grade2_ICSE_Cover_CMT2.indd All Pages
|
Bengaluru
|
hello@uolo.com �205
© 2024 Uolo EdTech Pvt. Ltd. All rights reserved.
NEP 2020 based
|
ICSE compliant | Technology powered
25/01/24 6:08 PM