Search Header Logo
Class 9 Algorithm and Flowchart

Class 9 Algorithm and Flowchart

Assessment

Presentation

Computers

9th - 12th Grade

Practice Problem

Easy

Created by

laxuman bista

Used 2+ times

FREE Resource

27 Slides • 1 Question

1

media
media
media

དཔལ་ལྡན་འབྲུག་གཞུང་།

ཤེས་རིག་དང་རིག་རྩལ་གོང་འཕེལ་ལྷན་ཁག།

Department of School Education

Ministry of Education & Skills Development

PYTHON FOR BEGINNERS

July 2023

Classes IX and X ICT Curriculum

ALGORITHM & FLOWCHART

Developed by Thinley & ICT teachers of Thimphu for ICT teachers of Bhutan as reference material

2

media

Algorithm

A step-by-step solution for specific problem

3

media

Why learn Algorithm?

To understand the core idea behind a problem.

To understand the flow of the problem.

To give the designer a clear explanation of the needs and goal of the issue.

To find a solution for the problem.

To provide a straightforward explanation of how it works without getting into too

much technical detail.

To analyze and evaluate the complexity (in terms of time and space) of a problem.

4

media

Algorithm

An algorithm is a set of well-defined steps or instructions used to solve specific

problems or perform a particular task.

Writing algorithms involves breaking down a complex problem into smaller and

more manageable steps. Usually, one of the following conventions is used while

writing algorithms:

Written descriptions.

Pseudo code.

For an algorithm, you need to specify:

1)

Input

2)

Process

3)

Output

5

media

Characteristics of Algorithm

Clear: The steps in the algorithm should be easy to understand.

Unambiguous: The steps in the algorithm should have only one possible

interpretation.

Inputs: The algorithm should have one or more inputs.

Outputs: The algorithm should have one or more outputs.

Finite: The algorithm should terminate after a finite number of steps.

Effective: The algorithm should produce the correct output for the given input.

General: The algorithm should be able to work with different inputs and produce

the correct output.

Independent: The algorithm should be independent of any programming

language.

6

media
media

Characteristics continue...

7

media

Example 1

Problem: Write an algorithm to multiply any two numbers and print the result.

STEP

Algorithm

1

START

2

Take input for x and y variable from the user.

3

Multiply x and y variables using * operator and assign the result to z

4

Print the variable Z

5

STOP/End

8

Open Ended

Write an algorithm to add any two numbers and display the result.

9

media

Example 2

Design an algorithm to add any two numbers and display the result.

STEP

Algorithm

1

START

2

Read any two numbers x , y

3

addition = x + y

4

Print addition

5

STOP/End

10

media

Example 3

Problem: Write an algorithm to find the greatest of two numbers.

STEP

Algorithm

1

START

2

Read any two numbers a, b

3

Check if a>b:

4

Print “a is greater than b”

5

Else:

6

Print “b is greater than a”

7

STOP/End

11

media

Activities

Activity 1: Write an algorithm that adds two numbers.

Activity 2: Write an algorithm to find the area of the circle.

Activity 3: Write an algorithm to calculate the perimeter of a rectangle.

Activity 4: Write an algorithm for finding the largest of any three given numbers.

Activity 5: Write an algorithm that prompts the user to input their exam marks and

determines whether they have passed or failed. The pass mark is 40 out of 100.

12

media

Answers

Activity 1: Write an algorithm that adds two numbers.

STEP

Algorithm

1

START

2

Read any two numbers a, b

3

addition = a + b

4

Print addition

5

STOP/End

13

media

Answers 2

Activity 2: Write an algorithm to find the area of the circle.

STEP

Algorithm

1

START

2

Read a radius of circle (r)

3

area = PI*r**2

4

Print area

5

STOP/End

14

media

Answers 3

Activity 3: Write an algorithm to calculate the perimeter of a rectangle.

STEP

Algorithm

1

START

2

Read a length and width [l, w]

3

perimeter = 2*(L+W) OR perimeter = l+w+l+w

4

Print perimeter

5

STOP/End

15

media

Answers 4

Activity 4: Write an algorithm for finding the largest of any three given numbers.

STEP

Algorithm

1

START

2

Read any three numbers x, y and z

3

Check if x>y and x>z:

4

Print “x is greater than y and z”

5

Check if y>x and y>z:

6

Print “y is greater than x and z”

7

else:

8

Print “z is greater than x and y”

9

STOP/End

16

media

Answers 5

Activity 5: Write an algorithm that prompts the user to input their exam marks and

determines whether they have passed or failed. The pass mark is 40 out of 100.

STEP

Algorithm

1

START

2

Enter any mark [m]

3

Check if m>=40:

4

Print ”Passed”

5

else:

6

Print “Failed”

7

STOP/End

17

media

Flowchart

Diagrammatic representation of an algorithm

18

media

Flowchart

A flowchart is a diagrammatic representation of an algorithm. It is a way of
visualizing the steps involved in a process or task.

A flowcharts can be helpful for both writing programs and explaining programs to
others.

Some of the most common symbols used to draw flowcharts are:

Start/End: The START and End of a flowchart can be represented by the oval

shape.

Process: The process of a flowchart can be represented by the rectangle shape.

Decision: The Decision of a flowchart can be represented by the diamond shape

Input/Output: The input/output of a flowchart can be represented by the

parallelogram shape

19

media
media

Symbols

20

media

Example 1

Draw a flowchart to find the addition of any two numbers.

STEP

Algorithm

1

START

2

Read any two numbers x, y

3

addition = x + y

4

Print addition

5

STOP/End

START

Read any two numbers x, y

addition = x + y

Print addition

End

21

media
media

Example 2

Algorithm

Step 1: START

Step 2: Store the value of a side in a variable named side

Step 3: Calculate and store the value of perimeter in the
variable named perimeter

Step 4: Display the perimeter

Step 5: END

1.Flowchart

Draw a flowchart to calculate the perimeter of a Square with side length of 5 units.

22

media
media

Example 3

STEP

Algorithm

1

START

2

Enter an age:

3

Check if age>=18:

4

Print “Eligible to cast vote”

5

else:

6

Print “Not eligible to cast vote”

7

STOP/End

Draw a flowchart to check whether the entered age is eligible for casting the vote.

23

media

Activities

Activity 1: Draw a flowchart to find multiplication any numbers entered by the user.

Activity 2: Draw a flowchart to find the area of the circle.

Activity 3: Draw a flowchart to calculate the perimeter of the rectangle.

Activity 4: Draw a flowchart to find the largest of any three numbers when a user reads

numbers from the keyboard.

Activity 5: Draw a flowchart that prompts the user to input their ICT exam mark and

determines whether they have passed or failed. The pass mark is 40 out of 100.

24

media

Answer 1

Activity 1: Draw a flowchart to find multiplication any numbers entered by the user.

START

Read any two numbers x, y

multiplication = x * y

Print multiplication

End

25

media

Answer 2

Activity 2: Draw a flowchart to find the area of the circle.

START

Read radius of circle [r]

area = PI*r**2

Print area

End

26

media

Answer 3

Activity 3: Draw a flowchart to calculate the perimeter of the rectangle.

START

Read a length and width [l, w]

perimeter = 2*(l+w)

Print perimeter

End

27

media

Answer 4

Activity 4: Draw a flowchart to find the largest of any three numbers when a user reads

numbers from the keyboard.

START

Read any three numbers x,y,z

End

Check
x>y and x>z

Check
y>x and y>z

Print “x is greater than y and z”

Print “y is greater than x and z”

Print “z is greater than x and y”

yes

yes

NO

NO

28

media

Answer 5

Activity 5: Draw the flowchart that prompts the user to input their ICT exam mark and

determines whether they have passed or failed. The pass mark is 40 out of 100.

START

Enter a mark [m]

End

Check
m>=40

Print “Passed”

Print “Failed”

yes
No

media
media
media

དཔལ་ལྡན་འབྲུག་གཞུང་།

ཤེས་རིག་དང་རིག་རྩལ་གོང་འཕེལ་ལྷན་ཁག།

Department of School Education

Ministry of Education & Skills Development

PYTHON FOR BEGINNERS

July 2023

Classes IX and X ICT Curriculum

ALGORITHM & FLOWCHART

Developed by Thinley & ICT teachers of Thimphu for ICT teachers of Bhutan as reference material

Show answer

Auto Play

Slide 1 / 28

SLIDE