0% found this document useful (0 votes)
28 views5 pages

5.1 What Will You Learn in This Chapter?

This document discusses sequences in programming and algorithms. It defines a sequence as a series of actions performed in a specific order, like a daily routine. An algorithm is a set of steps to solve a problem. Sequencing in algorithms means arranging the steps in the correct order to get the right result. The document provides an example of calculating the sum of two numbers and why swapping steps could cause a bug. It also discusses using sequences, conditions, and loops in a program to print all numbers between 0 and 100 that are divisible by 3. Finally, it includes some questions to test the reader's understanding.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views5 pages

5.1 What Will You Learn in This Chapter?

This document discusses sequences in programming and algorithms. It defines a sequence as a series of actions performed in a specific order, like a daily routine. An algorithm is a set of steps to solve a problem. Sequencing in algorithms means arranging the steps in the correct order to get the right result. The document provides an example of calculating the sum of two numbers and why swapping steps could cause a bug. It also discusses using sequences, conditions, and loops in a program to print all numbers between 0 and 100 that are divisible by 3. Finally, it includes some questions to test the reader's understanding.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

5.1 What will you learn in this chapter?

5.2 What is a Sequence?

A series of actions performed in a specific order is called sequence. For


example, our daily routine. Our daily routine is a series of actions that we
do every day as follows.

1. Wake up.

2. Have breakfast.

3. Take a shower.

4. Go to school.

5. Attend classes.

6. Have lunch.

7. Attend classes.

8. Get back home.

9. Do homework.

10. Watch TV.

11. Have dinner.

12. Go to sleep.

However, this routine might vary from person to person but for a specific
person this might be the routine. An algorithm is a set of steps to solve a
problem. A program is written based on an algorithm to get the required
result. Sequencing in algorithms is arranging the steps of an algorithm in a
correct sequence so that we get the correct outcome.

Page 52
Sequencing is important in algorithms. If the steps of an algorithm are not
in correct sequence, we will not get the required result.

For example, if we make a simple algorithm of calculating the sum of two


numbers, the steps would look like as the following in a flowchart.

If we swap 2 steps and add Num1 and Num2 before taking Num1 as input,
the program will not give the required result or give an error. This is called a
bug.

5.3 Sequencing with Loops and Conditions


Most programs consist of 3 main components – Sequence, Selections
(Conditions) and Loops.
Let’s write a program to get all the numbers divisible by 3 between 0 and
100. The flowchart for the algorithm would be as follows.

Page 53
In this example, we see that this program has a sequence of conditions and
loops.

5.4 Activity: Print number divisible by 3 from 1 to 100

Let’s try this activity in Minecraft using block code.

At the end of this activity the final output should look like shown in the
image below:

Page 54
Note: Minecraft is just one of the platforms to achieve this output. You can
use many similar platforms available online to achieve similar output like –
Scratch (https://scratch.mit.edu/) and Code.Org (https://code.org/)

5.5 Quiz time

Objective Type Questions

Standard Questions

1. Explain what a sequence in programming is?

2. Draw a flowchart to demonstrate sequence of activities that you do while


getting ready for school.

3. Write a pseudocode to explain sequence of activities that you perform


while giving an exam.

Page 55
Higher Order Thinking Skills (HOTS)

1. Write a program in block code to print all the prime numbers between 0
and 50.

2. Write a program in block code to print all the multiples of 7 from 0 to


100.

Applied Project

1. Problem Statement: Write a flow chart for the algorithm to determine if a


number is perfect square.

Page 56

You might also like