Ch 1: Algorithms and Flowcharts Class 9 AI Python Notes

Share with others

Ch 1: Algorithms and Flowcharts Class 9 AI Python Notes

Ch 1: Algorithms and Flowcharts Class 9 AI Python Notes


Introduction

Every machine follows a particular path of action. It goes through specific steps to accomplish the given task. For example, a microwave can warm food for us and does not perform any other functions because it is explicitly designed for this task, a washing machine can wash clothes for us and not do anything else.

What is an Algorithm?

A logical step-by-step method to solve the problem is called algorithm, in other words, an algorithm is a procedure for solving problems. Algorithms can be presented by natural languages, pseudo code and flowcharts, etc. for example

1. Algorithm to make an instant noodles

Steps are:

1. Take a pan and boil approx. 200 ml of water.

2. Add noodles and tastemaker to the boiling water.

3. Stir constantly and cook in the open pan till the water is soaked by the noodles.

4. Serve Hot

2. Algorithm to make an Tea

Steps are:

1. Take a pan and boil water.

2. Add tea leaves

3. Add milk, sugar according to your taste.

4. Filter it and serve

NOTE: There may be other ways to make instant noodles and Tea

What is a flowchart?

Flowchart is the graphical or pictorial representation of an algorithm with the help of different symbols, shapes and arrows. Various symbols used in flowchart are:

Algorithms and Flowcharts
Algorithms and Flowcharts

Q1. Write an algorithm to print numbers from 1 to 20. Also draw the flowchart.

ALGORITHM

1. Initialize X as 0,

2. Increment X by 1

3. Print X

4. If X is less than 20 then go back to step 2.

FLOWCHART

Algorithms and Flowcharts
Algorithms and Flowcharts

Q2. Write an algorithm and draw flowchart to convert Temperature from Fahrenheit (℉) to Celsius (℃)

Algorithm

Step 1: Read temperature in Fahrenheit

Step 2: Calculate temperature with formula C=5/9*(F-32)

Step 3: Print C

Flow Chart

Algorithm and Flowchart
Algorithm and Flowchart

Q3. Write an algorithm and draw flowchart to check whether a number is prime or not.

STEP 1: Start
STEP 2: Read num

STEP 3: Set i = 2

STEP 4: Repeat steps 5 and 6 until i < num

STEP 5: [Check whether num is divisible or not]

if num % i == 0 then

Goto step 7

Else

Goto step 6

STEP 6: Set i = i + 1

STEP 7: if i == num then

Print "Number is Prime"

Else

Print "Number is not Prime"

STEP 8: Stop
Algorithms and Flowcharts
Algorithms and Flowcharts

Q4. Write an algorithm on how does a traffic signal work?

ALGORITHM:

Step 1: Start

Step 2: Initialize signal to Green

Step 3: Display Green light for a specified time duration (e.g., 60 seconds)

Step 4: Change signal to Yellow

Step 5: Display Yellow light for a short duration (e.g., 5 seconds)

Step 6: Change signal to Red

Step 7: Display Red light for a specified duration (e.g., 55 seconds)

Step 8: Repeat from step 2

Q5. Write an algorithm to add two numbers.

Ans.

Step 1: Start

Step 2: Read the first number (say n1)

Step 3: Read the second number (say n2)

Step 4: Calculate the sum of n1 and n2

Step 5: S = n1 + n2

Step 6: Display the result (S)

Step 7: End

Q6. Write an algorithm to find average of two numbers.

Ans.

Step 1: Start

Step 2: Read the first number (say num1)

Step 3: Read the second number (say num2)

Step 4: Calculate the average of num1 and num2

Step 5: avrg = (num1 + num2)/2

Step 6: Display the result (avrg)

Step 7: End

Q7. Draw a flow chart to show the area and perimeter of rectangle.

Algorithms and Flowcharts
Algorithms and Flowcharts

Disclaimer : I tried to give you the correct Notes of Chapter 1: Algorithms and Flowcharts Class 9 (AI-417), but if you feel that there is/are mistakes in the Notes of Chapter 1: Algorithms and Flowcharts Class 9 given above, you can directly contact me at csiplearninghub@gmail.com. Also Share your valuable feedback about the above Notes of Chapter 1: Algorithms and Flowcharts or any other suggestion so that I can give better content to you. The Notes of Chapter 1: Algorithms and Flowcharts Class 9 are from NCERT BOOK available on CBSE website. The content is not copied from any other site.


Important Links

Class IX A.I. Book

Class IX AI Curriculum 2025-26

Class X AI Book

Class X AI Curriculum 2025-26

Python Manual

——————————————————————————————————————————

Unit 1 – A.I. Reflection Project Cycle and Ethics Class 9 Notes Important Points

Unit 1 – A.I. Reflection Project Cycle and Ethics Class 9 MCQ

Unit 1 – A.I. Reflection Project Cycle and Ethics Class 9 Question Answers

—————————————————————————————————————————–

Unit 2 – Data Literacy NOTES Important Points

Unit 2 – Data Literacy MCQ

Unit 2 – Data Literacy Question Answers

——————————————————————————————————————————

Unit 3 – Math in AI NOTES Important Points

Unit 3 – Math in AI MCQ

Unit 3 – Math in AI Question Answers

——————————————————————————————————————————

Unit 4 – Generative AI NOTES Important Points

Unit 4 – Generative AI MCQ

Unit 4 – Generative AI Question Answers


Share with others

Leave a Reply

error: Content is protected !!