Head office, Rana Pratap Bagh, Delhi011 2721 1512+91 97116 99511

A free printable book

Computers and coding for classes 6 to 8

8 lessons, each with worked examples, a try-at-home activity and a practice sheet. The practice sheets are together after the lessons, and the answer keys are at the very back.

  • Computers and coding
  • Classes 6-8
  • 8 lessons
  • 82 practice questions
  • Free to print

Contents

Free learning for kids, Gurukul Technicals Institute. Printed from engineergurukul.com/resources/kids/books/computers-6-8/

Contents

What is in this book

  1. 1Loops and patternsLearn how a loop repeats steps, how to spot patterns, and how to write long instructions in a short way.4 min
  2. 2If-then decisions (conditions)Learn how computers make choices using if, then and else, with true or false conditions and flowcharts.4 min
  3. 3Binary numbers: how computers countComputers use only 0 and 1. Learn place values 1, 2, 4, 8, 16 and how to change numbers to binary and back.5 min
  4. 4Flowcharts: drawing a planDraw a flowchart with start, step, decision and end shapes, follow the arrows, and plan any task before writing code.5 min
  5. 5Variables: storing valuesA variable is a labelled box in memory that holds a value; learn to set it, change it and trace it on paper step by step.5 min
  6. 6Input, process, outputEvery computer task takes input, processes it with steps, and gives output; learn to spot the three parts and write them in pseudocode.4 min
  7. 7Files, folders and saving workLearn what a file is, how folders organise files like a tree, what a file name and extension tell you, and why saving and backups matter.5 min
  8. 8Searching the web and checking sourcesChoose good keywords, read search results wisely, and check who wrote a page, when, and whether other sources agree before you trust it.5 min

Every lesson here can also be read on its own page, with links to related lessons. All printable books.

Lesson 1 of 8

Loops and patterns

Learn how a loop repeats steps, how to spot patterns, and how to write long instructions in a short way.

Let us begin

The big idea

Clap, stomp, clap, stomp, clap, stomp. Writing that out is slow, but we can say repeat 3 times: clap, stomp. This short way of repeating is called a loop. Programmers use loops all the time.

A loop repeats a set of steps again and again. Instead of writing the same steps many times, we write them once and say how many times to repeat.

A pattern is something that repeats in a regular way, like red, blue, red, blue. Loops and patterns go together: if you can see the pattern, you can write a loop for it.

We can draw a square with a loop. Repeat 4 times: walk forward, turn right 90 degrees. The same two steps happen four times, so the loop is short.

A loop must know when to stop. A loop that never stops is called an endless loop, and the computer would be stuck repeating forever.

Number patterns work like loops too. In 3, 6, 9, 12, we start at 3 and add 3 each time.

A loop that repeats clap and stompA large box labelled Repeat 3 times contains two smaller boxes, Clap and Stomp. An arrow goes from Clap to Stomp, and a return arrow goes underneath from Stomp back to Clap. Repeat 3 times Clap Stomp Result: clap, stomp, clap, stomp, clap, stomp
The loop goes round and round three times.

Worked examples

See how it works

  1. Counting actions

    Repeat 4 times: clap, clap, stomp. In one round there are 2 claps and 1 stomp, which is 3 actions. After 4 rounds: 4 x 2 = 8 claps, 4 x 1 = 4 stomps, and 4 x 3 = 12 actions altogether.

  2. Adding in a loop

    Start with total = 0. For each number from 1 to 5, add it to the total. 0+1 = 1, 1+2 = 3, 3+3 = 6, 6+4 = 10, 10+5 = 15. The final total is 15.

  3. A number pattern

    The pattern is 3, 6, 9, 12. Each step adds 3, so the loop is: start at 3, add 3 each time. The next number is 12 + 3 = 15.

  4. Drawing a square

    Repeat 4 times: forward 3 steps, turn right 90 degrees. Walking 3 steps four times is 12 steps in all. You end up where you started, having walked a square.

Try it at home

Loop dance

You will need

  • paper and pencil
  • an open floor space

What to do

  1. Write a dance of 3 moves, such as clap, jump, spin.
  2. Write it as a loop: repeat 4 times: clap, jump, spin.
  3. Do the dance and count how many moves you did in all.
  4. Change the loop to repeat 2 times and see how the dance changes.
  5. Now draw a pattern of shapes with pencil and write the loop that makes it.

Ask a grown-up: Make sure the floor space is clear. Jumping and spinning are done at a gentle level, and nobody should feel hurried.

Fun fact

A loop saves effort: a computer can repeat a step a million times without getting bored or tired.

Lesson 2 of 8

If-then decisions (conditions)

Learn how computers make choices using if, then and else, with true or false conditions and flowcharts.

Let us begin

The big idea

If it is raining, take an umbrella. Otherwise, wear a cap. You make choices like this every day. Computers do it too, using conditions that are either true or false.

A condition is a question that has only two answers: true or false. For example, 7 > 5 is true. 3 > 8 is false. Is it raining? is a condition too.

An if-then rule says: if the condition is true, then do this. We can add else: if it is not true, do something different. So a computer follows one path or the other, never both.

We can join conditions. AND means both must be true. OR means at least one must be true. For example, play cricket if it is Sunday AND it is not raining.

We can also chain rules: if the first is not true, check the next one. A flowchart draws this using a diamond for the question and arrows for the yes and no paths.

A decision flowchartA diamond asks Is it raining. An arrow labelled Yes goes down-left to a box saying Take an umbrella. An arrow labelled No goes down-right to a box saying Wear a cap. Is it raining? YES NO Take an umbrella Wear a cap The computer follows ONE path, depending on the answer.
The computer follows only one path.

Worked examples

See how it works

  1. Pass or fail

    Rule: if marks are 33 or more, then Pass, else Fail. For 45: is 45 >= 33? Yes, so Pass. For 28: is 28 >= 33? No, so Fail. For exactly 33: 33 >= 33 is true, so Pass.

  2. Even or odd

    Rule: if the number can be divided by 2 with nothing left over, say even, else say odd. For 14: 14 / 2 = 7, no remainder, so even. For 7: 7 / 2 leaves 1, so odd.

  3. Ticket price

    Rule: if age is less than 5, free. Else if age is 12 or less, half price. Else, full price. Age 4: free. Age 10: not under 5, but 12 or less, so half price. Age 30: neither, so full price.

  4. Using AND

    Rule: play cricket if it is Sunday AND it is not raining. On a Sunday that is raining, the second part is false, so AND fails and we do not play.

Try it at home

Even-odd clapping game

You will need

  • paper slips
  • pencil
  • a friend or family member

What to do

  1. Write numbers from 1 to 10 on slips of paper and fold them.
  2. Make a rule: if the number is even, clap. Else, stomp.
  3. Pick a slip and follow the rule. Your friend checks if you are correct.
  4. Make a new rule, like: if the number is more than 5, jump. Else, spin.
  5. Write your rule as an if-then-else sentence.

Ask a grown-up: An adult can help make up extra rules and check the answers. Keep the movements gentle.

Lesson 3 of 8

Binary numbers: how computers count

Computers use only 0 and 1. Learn place values 1, 2, 4, 8, 16 and how to change numbers to binary and back.

Let us begin

The big idea

We count with ten digits, 0 to 9. A computer only has two: 0 and 1. This way of counting is called binary. With just 0s and 1s a computer can show numbers, words, pictures and music.

Inside a computer, tiny switches are either off or on. Off is written 0 and on is written 1. Each 0 or 1 is called a bit.

In our usual numbers, the places are 1, 10, 100 and so on, each ten times bigger. In binary, each place is two times bigger. From the right, the place values are 1, 2, 4, 8, 16, and so on.

To read a binary number, add the place values that have a 1. For 1011: 8 + 0 + 2 + 1 = 11.

To write a number in binary, find the biggest place value that fits, take it away, and carry on with what is left. Put 1 in every place value you used and 0 in the rest.

Eight bits together are called a byte.

The number 13 in binaryA table with four boxes in the top row showing place values 8, 4, 2 and 1, and four boxes below showing the bits 1, 1, 0 and 1. Beneath it, a line says 8 plus 4 plus 0 plus 1 equals 13.The number 13 in binary Value 8 4 2 1 Bit 1 1 0 1 8 + 4 + 0 + 1 = 13 So 1101 in binary is 13
Add the place values that have a 1.

Worked examples

See how it works

  1. Binary to usual number: 1011

    Place values from the right are 1, 2, 4, 8. So 1011 has: 1 x 8 + 0 x 4 + 1 x 2 + 1 x 1 = 8 + 0 + 2 + 1 = 11.

  2. Usual number to binary: 13

    13 - 8 = 5, so use 8. 5 - 4 = 1, so use 4. 2 does not fit in 1, so skip 2. 1 - 1 = 0, so use 1. The places 8, 4, 2, 1 get 1, 1, 0, 1. So 13 is 1101. Check: 8 + 4 + 0 + 1 = 13.

  3. A five-bit number: 10010

    Place values from the right: 1, 2, 4, 8, 16. The digits are 1, 0, 0, 1, 0 from the left, so 1 x 16 + 0 x 8 + 0 x 4 + 1 x 2 + 0 x 1 = 16 + 2 = 18.

  4. Usual number to binary: 25

    25 - 16 = 9, so use 16. 9 - 8 = 1, so use 8. 4 does not fit in 1, 2 does not fit in 1. 1 - 1 = 0, so use 1. The places 16, 8, 4, 2, 1 get 1, 1, 0, 0, 1. So 25 is 11001. Check: 16 + 8 + 1 = 25.

Try it at home

Binary cards

You will need

  • 4 small pieces of paper or card
  • pencil

What to do

  1. Draw dots on each card: 1 dot, 2 dots, 4 dots and 8 dots.
  2. Put the cards in a row with the 8 on the left and the 1 on the right.
  3. Turn a card face up for 1, or face down for 0. Make the number 5. You need the 4 and 1 cards face up.
  4. Make 9, 12 and your age. Write down the 1s and 0s you used.
  5. Ask a friend to show a number with the cards and you read it.

Ask a grown-up: An adult can help check the answers by adding the face-up cards. This works without a computer.

Fun fact

Using just the fingers of one hand as five bits, you can count in binary from 0 all the way to 31.

Lesson 4 of 8

Flowcharts: drawing a plan

Draw a flowchart with start, step, decision and end shapes, follow the arrows, and plan any task before writing code.

Let us begin

The big idea

Before a programmer writes code, they often draw the plan as a picture. That picture is called a flowchart. You can draw one with just paper and a pencil, and it works for recipes, games and sums too.

A flowchart uses a few simple shapes joined by arrows. A rounded box (oval) marks Start and End. A rectangle is a step: something to do, like "add 5" or "boil the water". A parallelogram is used for input or output, like "ask for a number" or "print the answer".

A diamond is a decision. It asks a yes or no question, such as "is the number bigger than 10?". Two arrows leave a diamond: one labelled Yes and one labelled No. Every other shape has exactly one arrow leaving it.

To follow a flowchart, put your finger on Start and move along the arrows. At each diamond, answer the question and take the matching arrow. You stop when you reach End. If an arrow goes back up to an earlier box, that is a loop: the same steps repeat until the decision says to stop.

A good flowchart has one Start, at least one End, arrows that all point somewhere, and short clear words in every box. If you get lost while following it, the chart needs fixing before anyone writes code from it.

Flowchart for checking whether a number is evenAn oval labelled Start at the top leads to a parallelogram labelled input N, then to a diamond asking whether N divided by 2 leaves remainder 0. The Yes arrow goes to a box printing even, the No arrow to a box printing odd. Both lead to an End oval. Start Input a number N N divided by 2 remainder 0? Yes Print "even" No Print "odd" End Oval = start / end Rectangle = step Diamond = decision Slanted box = input / output
The four flowchart shapes: oval for start and end, parallelogram for input and output, rectangle for a step, diamond for a decision.

Worked examples

See how it works

  1. Crossing the road

    Start. Step: stand at the kerb and look right, left, right. Decision: is the road clear? If No, go back to the look step. If Yes, step: walk straight across. End. The No arrow makes a loop: you keep looking until it is safe.

  2. Is the number even?

    Start. Input: take a number N. Decision: does N divided by 2 leave remainder 0? If Yes, output "even". If No, output "odd". End. Try N = 14: 14 divided by 2 is 7 remainder 0, so the Yes arrow is taken and the output is "even".

  3. Counting to 5

    Start. Step: set count to 1. Output: print count. Decision: is count equal to 5? If No, step: add 1 to count, then go back to the print box. If Yes, End. Following it prints 1, 2, 3, 4, 5 and then stops.

Try it at home

Flowchart your morning

You will need

  • Two or three sheets of paper
  • A pencil and an eraser
  • A coin or a small stone to use as a marker

What to do

  1. List the first six things you do after waking up, for example brush teeth, bathe, eat breakfast, pack bag.
  2. Draw an oval for Start, then a rectangle for each thing, joined by arrows going down.
  3. Add one diamond with a question, such as "is it raining?", and give it a Yes arrow (take an umbrella) and a No arrow (go straight to the bag).
  4. Finish with an End oval. Now place the coin on Start and move it along the arrows, saying each step aloud.
  5. Ask a family member to follow your chart with the coin. If they get stuck, fix the chart.

Lesson 5 of 8

Variables: storing values

A variable is a labelled box in memory that holds a value; learn to set it, change it and trace it on paper step by step.

Let us begin

The big idea

When a computer does a sum or keeps a game score, it must remember numbers and words while it works. It keeps them in variables. Think of a variable as a labelled box that can hold one value at a time.

A variable has a name and a value. The name is the label on the box, such as score or age. The value is what is inside, such as 10 or "Asha". We write "score = 10" to mean: put 10 in the box called score.

The value can change; that is why it is called a variable. If we later write "score = score + 5", the computer reads the old value (10), adds 5, and puts the new value (15) back into the same box. The old value is gone.

Good names say what the box is for: total, count, name, length. A name like x works, but a name like marks is easier to understand when you read the plan later.

To trace a program on paper, draw a table with one column for each variable. After every line, write the new value in the table. This is exactly what the computer does in its memory, and it is the best way to find mistakes.

Memory boxes before and after an instructionThree labelled boxes, score, lives and name, hold the values 10, 3 and Asha. An arrow labelled score = score + 5 points to a second row of the same boxes where score now holds 15 and the others are unchanged.Before score 10 lives 3 name "Asha" score = score + 5 After score 15 lives 3 name "Asha"
Each variable is a labelled box. An instruction changes only the box it names; the others keep their values.

Worked examples

See how it works

  1. A simple trace

    Lines: a = 4, b = 7, c = a + b, a = a + 1. Trace: after line 1, a is 4. After line 2, b is 7. After line 3, c is 11. After line 4, a is 5 and c is still 11, because c was worked out before a changed.

  2. Swapping two values

    We want to swap x = 2 and y = 9. If we write x = y first, x becomes 9 and the 2 is lost. So we use a third box: temp = x (temp is 2), then x = y (x is 9), then y = temp (y is 2). Now x is 9 and y is 2.

  3. Counting with a variable

    count = 0, then repeat 3 times: count = count + 2. Trace: 0, then 2, then 4, then 6. The final value of count is 6.

Try it at home

Variable boxes with bottle caps

You will need

  • Three small bowls or cups
  • Sticky notes or paper slips for labels
  • About 20 bottle caps, beans or coins
  • Paper and a pencil for the trace table

What to do

  1. Label the bowls a, b and total. Put 3 caps in a and 5 caps in b. This is a = 3, b = 5.
  2. Do "total = a + b": count a and b, and put that many caps (8) into total. Do not take the caps out of a and b; the computer copies values, it does not move them.
  3. Do "a = a + 2": add 2 caps to bowl a. Now a holds 5. Does total change? No, it still holds 8.
  4. Write a trace table on paper with columns a, b, total and fill in a row after each step.
  5. Make up three new lines of your own and let someone else carry them out with the bowls.

Lesson 6 of 8

Input, process, output

Every computer task takes input, processes it with steps, and gives output; learn to spot the three parts and write them in pseudocode.

Let us begin

The big idea

A calculator, a washing machine and a video game all do the same three things: take something in, work on it, and give something out. Computer scientists call this input, process, output. Once you can see these three parts, you can plan any program.

Input is what goes into the computer: numbers typed on a keyboard, a click of the mouse, a photo from a camera or a sound from a microphone. In a plan we write INPUT followed by the variable that stores it, for example INPUT length.

Process is the work the computer does with the input: adding, comparing, sorting, counting. This is where the steps of the algorithm live, for example area = length * breadth.

Output is what comes out: words on the screen, a printed page, a sound or a light. We write OUTPUT followed by what to show, for example OUTPUT area.

Writing a plan with these simple English-like words is called pseudocode. It is not a real programming language, so nothing runs it, but it is clear enough that a person could follow it, and it can be turned into any real language later.

Input, process, output for finding an areaThree boxes in a row joined by arrows. The first, labelled Input, holds length 6 and breadth 4. The middle, labelled Process, holds area = length times breadth. The last, labelled Output, holds 24. Examples of devices appear under each box. INPUT length = 6 breadth = 4 PROCESS area = length * breadth OUTPUT 24 keyboard, mouse, camera, microphone the processor follows the steps screen, printer, speaker Every program: take in, work on, give out
Information flows from left to right: input is taken in, the process works on it, and the output comes out.

Worked examples

See how it works

  1. Area of a rectangle

    INPUT length. INPUT breadth. area = length * breadth. OUTPUT area. Trace with length = 6 and breadth = 4: area = 24, and the output is 24.

  2. Average of three marks

    INPUT m1, m2, m3. total = m1 + m2 + m3. average = total / 3. OUTPUT average. With marks 70, 80 and 90: total = 240, average = 80.

  3. Spotting the parts in daily life

    A washing machine: input is dirty clothes, water and the programme you choose; process is washing, rinsing and spinning; output is clean wet clothes. A calculator: input is the keys you press, process is the sum, output is the number on the display.

Try it at home

Be the computer

You will need

  • Paper slips for inputs
  • A pencil
  • A bowl

What to do

  1. On paper write this pseudocode: INPUT a. INPUT b. sum = a + b. double = sum * 2. OUTPUT double.
  2. Write five numbers on slips and put them in the bowl.
  3. A friend picks two slips (the input) and gives them to you. You are the processor: follow the lines in order and write each variable value.
  4. Say the final OUTPUT aloud. Then swap roles.
  5. Change the process line to double = sum * 3 and run it again. Which part changed: input, process or output?

Lesson 7 of 8

Files, folders and saving work

Learn what a file is, how folders organise files like a tree, what a file name and extension tell you, and why saving and backups matter.

Let us begin

The big idea

Every drawing, essay or photo on a computer is kept as a file. Files are put into folders so you can find them again. Knowing how this works stops you losing your work and helps you keep things tidy.

A file is a named collection of information saved on the computer, such as a story, a picture or a song. Every file has a name, like "my-poem", and usually an extension after a dot, like .txt, .docx, .jpg or .mp3. The extension tells the computer what kind of file it is and which program should open it.

A folder (also called a directory) is a container for files and for other folders. Folders inside folders make a tree. The full address of a file, such as Documents / School / Science / volcano.docx, is called its path.

While you are typing, your work lives in the computer memory (RAM), which is wiped when the power goes off. Saving copies it to storage (the hard disk or a memory card), which keeps it. Save often, and give files clear names: "science-project-volcano" is far better than "new document 3".

A backup is a second copy kept somewhere else, such as a pen drive or another computer. If one copy is lost or damaged, the other is safe. Deleting a file usually moves it to the Recycle Bin or Trash first, from where it can be brought back until the bin is emptied.

A folder treeA tree diagram. Documents is at the top. Below it are School and Family. Below School are Maths and Science. Science contains the file volcano.docx and Family contains birthday.jpg. The path to volcano.docx is written under the tree. Documents School Family Maths Science volcano.docx birthday.jpg yellow = folder blue = file Path: Documents / School / Science / volcano.docx
Folders inside folders make a tree. The path lists every folder from the top down to the file.

Worked examples

See how it works

  1. Reading a file name

    The file holiday-photo.jpg has the name "holiday-photo" and the extension ".jpg". The .jpg tells us it is a picture, so it will open in a photo viewer. A file called essay.docx is a word processor document.

  2. A folder tree

    Suppose the Documents folder contains two folders, School and Hobbies. School contains Maths and Science. Science contains volcano.docx. The path to that file is Documents / School / Science / volcano.docx. Three folders deep.

  3. Why saving matters

    Priya typed a two-page story but never pressed save. The power went off. Her story was only in memory, so it was lost. Rohan saved every ten minutes and also copied the file to a pen drive, so even when his laptop broke, his story was safe.

Try it at home

A paper filing system

You will need

  • Four or five envelopes or folded sheets of paper to act as folders
  • Small slips of paper to act as files
  • A pencil
  • A shoe box or a big envelope to act as the main Documents folder

What to do

  1. Label the box Documents. Label two envelopes School and Family and put them in the box.
  2. Inside School, put two smaller envelopes labelled Maths and Science.
  3. Write five pretend files on slips, each with a name and an extension: tables.txt, river-map.jpg, birthday.jpg, volcano.docx, song.mp3. Put each in the folder where it belongs.
  4. Write the full path for each slip, for example Documents / School / Science / volcano.docx.
  5. Ask someone to find river-map.jpg using only the path you wrote. Was it quick? That is the point of folders.

Lesson 8 of 8

Searching the web and checking sources

Choose good keywords, read search results wisely, and check who wrote a page, when, and whether other sources agree before you trust it.

Let us begin

The big idea

The web has more pages than anyone could ever read, and not all of them are true. A search engine helps you find pages, but you must decide which ones to trust. This lesson shows you how to search well and how to check what you find.

A search engine is a website that keeps a huge index of other pages. When you type words, it shows pages that match. Short, exact keywords work best: "largest planet solar system" finds better results than "can you please tell me which is the biggest planet". Putting a phrase in quotation marks asks for those exact words together.

The results page is a list of links with a title and a short snippet each. The first results are not always the best. Some are advertisements, marked with the word Ad or Sponsored. Read the title and the website address before you click.

To check a page, ask four questions. Who wrote it: a known organisation, a school, a museum, a newspaper, or an unknown person? When was it written: is it recent enough for the topic? Why was it written: to inform, to sell something, or to make you angry? Do other good sources say the same thing?

Website addresses give clues. Addresses ending in .gov.in or .nic.in belong to the Government of India, .ac.in and .edu.in are used by educational institutions, and .org is often used by non-profit groups. Anyone can buy a .com or .in address, so those need more checking. If something seems too amazing to be true, check it in two more places before believing it.

Four questions to check a web pageA web page is drawn in the centre with a title bar. Four labelled boxes around it hold the questions: Who wrote it, When was it written, Why was it written, and Do other sources agree. Arrows point from each box to the page. www.example.in/water-cycle WHO? author, organisation WHEN? date it was written WHY? inform, sell, anger? AGREE? two more sources a web page
Before trusting a page, ask who, when, why, and whether other good sources agree.

Worked examples

See how it works

  1. Choosing keywords

    Question: what is the height of Mount Everest? Weak search: "how tall is that really big mountain in the Himalayas". Better search: "Mount Everest height metres". The result 8,849 metres appears on survey and encyclopedia pages, and several sources agree.

  2. Comparing two pages

    Page A about the water cycle is on a science museum site, written last year, with the author named and a list of references. Page B is on a personal blog, has no date, no author and many pop-up advertisements. Page A is far more trustworthy. Page B might still be right, but you must check it.

  3. Spotting a trick

    A page says "Scientists prove chocolate cures all illness, share before it is deleted!". Warning signs: a huge claim, no named scientist, a push to share quickly, and no other source reports it. This is almost certainly false.

Try it at home

The source detective

You will need

  • Paper and a pencil
  • Any three printed things in the house: a newspaper, a textbook page, a leaflet or advertisement

What to do

  1. Draw a table with four columns: Who wrote it, When, Why, and Would I trust it for homework.
  2. Fill in a row for each printed item. The advertisement is written to sell, the textbook to teach, the newspaper to inform (and sometimes to entertain).
  3. Pick one fact from the newspaper. Where else could you check it? Write two places.
  4. Now write three good search keywords for a homework question you have this week, without extra words like "please" or "tell me".
  5. If an adult allows it, try your keywords online together and apply the four questions to the first result.

Ask a grown-up: Going online should be done with a parent or guardian present, with safe search switched on.

Part two

Practice sheets

One sheet for each of the 8 lessons. Write your name and the date at the top, answer in the spaces, then check with the answer keys at the back.

Practice sheet

Loops and patterns

Practice sheet: Loops and patterns (Classes 6-8, Computers and coding)

  1. In one sentence, what is a loop?
  2. Write jump, jump, jump, jump, jump using a loop.
  3. Repeat 4 times: clap, stomp. How many claps are there?
  4. Repeat 3 times: clap, clap, stomp. How many actions are there in all?
  5. What comes next: red, blue, red, blue, red, ?
  6. Which loop draws a square?
  7. Repeat 4 times: forward 3 steps, turn right. How many steps are walked in all?
  8. Start with 2. Repeat 5 times: add 4. What is the final number?
  9. To draw an equilateral triangle with repeat 3 times, how many degrees should you turn each time?
  10. Find the next two numbers: 1, 2, 4, 8, ?, ?

Practice sheet

If-then decisions (conditions)

Practice sheet: If-then decisions (conditions) (Classes 6-8, Computers and coding)

  1. Is 7 > 5 true or false?
  2. Complete the rule: If it is hot, then ____.
  3. What does else do in an if-then-else rule?
  4. Rule: if a number is greater than 10, say Big, else say Small. What do we say for 10?
  5. Rule: if marks are 33 or more, Pass. Does 33 pass?
  6. Ticket rule: under 5 free, 12 or less half price, else full price. What does a 12-year-old pay?
  7. Play cricket if it is Sunday AND it is not raining. It is Sunday and it is raining. Do we play?
  8. Take a bag if you are going shopping OR going to school. You are only going to school. Do you take a bag?
  9. Rule: if the last digit is 0 or 5, the number divides by 5, else it does not. Use it for 1,203.
  10. Write an if-then-else rule for crossing a road with a signal.
  11. Is 2,345 divisible by 5? Use the last-digit rule and check by dividing.

Practice sheet

Binary numbers: how computers count

Practice sheet: Binary numbers: how computers count (Classes 6-8, Computers and coding)

  1. Which two digits does a computer use for counting?
  2. What are the first four place values in binary, starting from the right?
  3. Change 101 to a usual number.
  4. Change 110 to a usual number.
  5. Change 1001 to a usual number.
  6. Write 6 in binary.
  7. Write 10 in binary.
  8. Change 1111 to a usual number.
  9. Write 20 in binary.
  10. Change 11111 to a usual number.
  11. How many bits are in one byte?

Practice sheet

Flowcharts: drawing a plan

Practice sheet: Flowcharts: drawing a plan (Classes 6-8, Computers and coding)

  1. Which flowchart shape is used for Start and End?
  2. Which shape asks a yes or no question?
  3. How many arrows leave a decision diamond?
  4. In the "is the number even?" flowchart, which arrow is taken for N = 9?
  5. What does it mean when an arrow goes back up to an earlier box?
  6. Which shape would you use for "print the total"?
  7. In the counting flowchart, what is printed if the decision is "is count equal to 3?" instead of 5?
  8. Name one thing that is wrong if a flowchart has no End shape.
  9. Draw in words a two-step flowchart for making tea with one decision in it.
  10. Why is it useful to draw a flowchart before writing a program?

Practice sheet

Variables: storing values

Practice sheet: Variables: storing values (Classes 6-8, Computers and coding)

  1. What two things does every variable have?
  2. After "marks = 40" and then "marks = marks + 10", what is in marks?
  3. Trace: p = 6, q = 2, r = p * q. What is r?
  4. In the trace above, if we then write p = 1, does r change?
  5. Why does swapping x and y need a third variable?
  6. Which is a better variable name for the number of students: n or students? Why?
  7. count = 1; repeat 4 times: count = count + 3. What is count at the end?
  8. In "total = a + b", do the values in a and b get used up?
  9. What is a trace table used for?
  10. After a = 5, b = a, a = 8, what are a and b?

Practice sheet

Input, process, output

Practice sheet: Input, process, output (Classes 6-8, Computers and coding)

  1. Name the three parts of every computer task, in order.
  2. Is a keyboard an input device or an output device?
  3. Is a printer an input device or an output device?
  4. In the area pseudocode, which line is the process?
  5. What is pseudocode?
  6. Run this: INPUT n. result = n * n. OUTPUT result, with n = 7. What is the output?
  7. For a microwave oven, what is the input, the process and the output?
  8. Write pseudocode to take a price and output the price with 10 added.
  9. A program outputs the wrong average. Which part would you check first: the input, the process or the output?
  10. Why is pseudocode written in simple English words instead of a real language?

Practice sheet

Files, folders and saving work

Practice sheet: Files, folders and saving work (Classes 6-8, Computers and coding)

  1. What is a file?
  2. In the name report.docx, which part is the extension?
  3. What does the extension .jpg usually tell you?
  4. What is another name for a folder?
  5. Write the path to birthday.jpg in the diagram.
  6. Why is work lost if the power goes off before you save?
  7. Which is the better file name: "doc1" or "hindi-essay-diwali"? Why?
  8. What is a backup?
  9. What usually happens to a file when you delete it?
  10. How many folders deep is volcano.docx below Documents in the diagram?

Practice sheet

Searching the web and checking sources

Practice sheet: Searching the web and checking sources (Classes 6-8, Computers and coding)

  1. What does a search engine do?
  2. Which search is better: "please tell me about elephants in India" or "Indian elephant habitat"? Why?
  3. What do quotation marks around a phrase do in a search?
  4. What does the label Ad or Sponsored next to a result mean?
  5. List the four questions for checking a page.
  6. Which address ending belongs to the Government of India?
  7. A page has no author, no date and asks you to share it quickly. Is it trustworthy?
  8. Why should you check an amazing claim in two more places?
  9. Are the first results on the page always the best?
  10. Give one clue that a page was written to sell something.

Part three

Answer keys

The answers to every practice sheet, in the same order as the lessons. Parents and teachers may like to keep these pages separately.

Answer key

Answers: Loops and patterns

  1. A loop repeats a set of steps again and again.
  2. Repeat 5 times: jump.
  3. 4 claps (and 4 stomps).
  4. 3 x 3 = 9 actions.
  5. blue (and then red).
  6. Repeat 4 times: forward, turn right 90 degrees.
  7. 4 x 3 = 12 steps.
  8. 2 + 4 x 5 = 2 + 20 = 22.
  9. 120 degrees.
  10. 16 and 32 (each number doubles).

Answer key

Answers: If-then decisions (conditions)

  1. True.
  2. Sample: wear a hat (or drink water).
  3. It gives the other action to do when the condition is not true.
  4. Small, because 10 is not greater than 10.
  5. Yes, because 33 is 33 or more.
  6. Half price, because 12 is not under 5 but is 12 or less.
  7. No, because AND needs both parts to be true and it is raining.
  8. Yes, because with OR one true part is enough.
  9. The last digit is 3, so it is not divisible by 5.
  10. Sample: If the signal is green and the road is clear, then cross, else wait.
  11. Yes. The last digit is 5, and 2,345 / 5 = 469 with nothing left over.

Answer key

Answers: Binary numbers: how computers count

  1. 0 and 1.
  2. 1, 2, 4, 8.
  3. 4 + 0 + 1 = 5.
  4. 4 + 2 + 0 = 6.
  5. 8 + 0 + 0 + 1 = 9.
  6. 6 = 4 + 2, so 110.
  7. 10 = 8 + 2, so 1010.
  8. 8 + 4 + 2 + 1 = 15.
  9. 20 = 16 + 4, so 10100.
  10. 16 + 8 + 4 + 2 + 1 = 31.
  11. 8 bits.

Answer key

Answers: Flowcharts: drawing a plan

  1. A rounded box (oval).
  2. The diamond.
  3. Two: one for Yes and one for No.
  4. The No arrow, because 9 divided by 2 leaves remainder 1, so the output is "odd".
  5. It is a loop: the earlier steps repeat until the decision sends you another way.
  6. A parallelogram (slanted box), because printing is output.
  7. 1, 2, 3 and then it stops.
  8. Anyone following it can never finish; every path must reach an End.
  9. Start, boil water, add tea leaves, decision: do you want milk? Yes: add milk, No: skip, pour, End. (Any sensible answer with a diamond is correct.)
  10. You can see mistakes and missing steps early, and others can understand the plan before any code is written.

Answer key

Answers: Variables: storing values

  1. A name and a value.
  2. 50
  3. 12, because 6 times 2 is 12.
  4. No, r stays 12; it was calculated before p changed.
  5. Writing x = y first overwrites x, so the old value of x would be lost. temp keeps a copy.
  6. students, because it tells the reader what the value means.
  7. 13: the trace is 1, 4, 7, 10, 13.
  8. No, the values are copied, not moved; a and b keep their values.
  9. Following a program line by line on paper, writing each variable value after every step, to see what happens and find mistakes.
  10. a is 8 and b is 5, because b copied the value 5 before a was changed.

Answer key

Answers: Input, process, output

  1. Input, process, output.
  2. Input.
  3. Output.
  4. area = length * breadth.
  5. A plan written in simple English-like steps that a person can follow; it is not run by a computer.
  6. 49
  7. Input: the food and the time you set. Process: heating. Output: hot food (and the beep).
  8. INPUT price. newprice = price + 10. OUTPUT newprice.
  9. The process, because that is where the calculation is done (though checking the input is also sensible).
  10. So that anyone can read it and it can later be turned into any programming language.

Answer key

Answers: Files, folders and saving work

  1. A named collection of information saved on a computer, such as a story, picture or song.
  2. .docx
  3. That the file is a picture (a photo).
  4. A directory.
  5. Documents / Family / birthday.jpg.
  6. Unsaved work is only in memory (RAM), which is wiped when the power goes; saving copies it to storage.
  7. hindi-essay-diwali, because the name tells you what is inside without opening it.
  8. A second copy of a file kept somewhere else, such as a pen drive, in case the first copy is lost.
  9. It goes to the Recycle Bin or Trash, from where it can be restored until the bin is emptied.
  10. Two folders (School, then Science).

Answer key

Answers: Searching the web and checking sources

  1. It keeps an index of web pages and shows the pages that match the words you type.
  2. "Indian elephant habitat", because short exact keywords match better than a long sentence.
  3. They ask for those exact words together, in that order.
  4. Someone paid to have that result shown; it is an advertisement.
  5. Who wrote it, when was it written, why was it written, and do other sources agree.
  6. .gov.in (also .nic.in).
  7. No; those are warning signs, so it should not be trusted without checking.
  8. Because a single page can be wrong or made up; if good sources agree it is much more likely to be true.
  9. No; some are advertisements and others may be poor pages, so read the title and address first.
  10. Any of: lots of advertisements, a Buy now button, prices, or praise for one product only.
WhatsApp us