CH 1 Algorithm and Flowchart
CH 1 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.
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
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
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