0% found this document useful (0 votes)
139 views

CH 1 Algorithm and Flowchart

Uploaded by

Sabree Pavi
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
139 views

CH 1 Algorithm and Flowchart

Uploaded by

Sabree Pavi
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

ALGORITHM AND FLOWCHART

What is an Algorithm?
An algorithm is a procedure or set of rules
that defines how a program is to be executed.

We can say that it is a set of instructions for


solving a well-defined computational problem.
Ex. 1. Write the algorithm to celebrate New Year.
Algorithm:
Step 1: Start
Step 2: Prepare a guest list for New Year party
Step 3: Decide the venue, food menu, games and fun
activities for the party
Step 4: Invite the guests for the party
Step 5: On New Year eve, get ready and enjoy the party
Step 6: Stop
Ex. 2. Write the algorithm to make tea/coffee.
Algorithm:
Step 1: Start
Step 2: Boil water in a saucepan
Step 3: Add tea to boiling water
Step 4: Add sugar to boiling water
Step 5: Add milk to boiling water
Step 6: Boil this water with all the ingredients for 2 mins
Step 7: Sieve the tea in a cup
Step 8: Stop
Ex. 3. Write the algorithm to find the sum of
two given numbers.
Algorithm: To find the sum of two given numbers:
Step 1: Start
Step 2: Read A , B
Step 3: Let Sum= A+B
Step 4: Print Sum
Step 5: Stop.
Ex. 4. Write the algorithm to check whether
the given number is even or odd.(Selective
statement)
Algorithm: To find the sum of two given numbers:
Step 1: Start
Step 2- Read the number.
Step 3- if number%2==0 then the number is even.
Step 4- else number is odd.
Step 5- display the output.
Step 6- Stop
Conclusion
Algorithm
Algorithms are step-by-step instructions that tell a
computer or a person how to solve a problem.

Algorithms must have a clear set of instructions, a finite


number of steps, be effective, and be generalizable.

Algorithmic thinking is an important problem-solving


skill.

Think about how you can use algorithms to solve


problems in your daily life.
What is an Flowchart?
A flowchart is a graphical representation of
the steps a program takes to process data.

It is a diagrammatic representation of an
algorithm.
Flowchart symbols:
Ex. 1. Draw a flowchart to find the sum of two given
numbers.
Ex. 2. Draw a flowchart to check whether the given
number is odd or even.
1. Write algorithms and draw flowcharts for the following:
Accept the age of a person and check whether he/she is
eligible to vote or not. A person is eligible to vote only when
he/she is 18 years or more.
Flowchart
Algorithm
► Step 1: Start
► Step 2: Accept the age of the
person.
► Step 3: If age is greater than or
equal to 18, then display 'You are
eligible to vote'.
► Step 4: If age is less than 18, then
display 'You are not eligible to
vote'.
► Step 5: Stop
Conclusion
Flowchart

Flowcharts are a helpful tool for organizing and visualizing


the steps of a process or decision-making.

They can be used in many fields, such as science,


technology, engineering, mathematics, and art.

Flowcharts consist of shapes, lines, and text that show the


sequence, condition, and action of each step.
The most common shapes are start/end, process,
decision, and connector.

Flowcharts can help you save time, avoid mistakes, and


communicate ideas effectively.

By learning how to read and create flowcharts, you can


develop your critical thinking, problem-solving, and
teamwork skills.

You can also apply flowcharts to real-life situations, such


as planning a party, fixing a bike, or programming a
game.
Questions:

Question 1
Which of the following is used as the beginning step in an algorithm?

► Get
► Set
► Start
► Stop
Answer
Start
Reason — Start is used as the beginning step
in an algorithm.
Questions:

Question 2
Which of the following boxes is used for displaying an output statement?

► Rectangular box
► Rhombus box
► Parallelogram box
► Oval box
Answer
Parallelogram box
Reason — The output statement is
represented by a parallelogram.
Questions:

Question 3

► Why is Algorithmic Thinking important?


Answer

Algorithmic thinking is a problem-solving
technique that involves breaking down
complex problems into smaller, more
manageable tasks.

Algorithmic thinking helps us to solve
problems more efficiently and effectively.

Algorithmic thinking is an important skill in
many fields, such as computer science,
mathematics, and engineering.
Questions:

Question 4
► Write an algorithm to show your daily morning routine.
Answer
Step 1: Start
Step 2: I wake up early.
Step 3: Refresh myself.
Step 4: Brush my teeth.
Step 5: Take a bath.
Step 6: Take Breakfast.
Step 7: Get ready for school.
Step 8: Spend hours for studying.
Step 9: Come back home.
Thank you

You might also like