ALGORITHMS & FLOWCHART

 ALGORITHMS & FLOWCHART


1.     What is Algorithm?

Ans: Before writing a program code for a given problem in computer science, it is essential to design a set of steps to be followed to solve the problem successfully. This set of steps is called an algorithm.

 2.     What is a Flowchart?

Ans:  Flowchart is a diagrammatic representation of the step-by-step plan to be followed for solving a task/problem. This diagrammatic representation is made up of shapes like boxes, diamonds, parallelograms, circles, ellipses connected by arrows. Each shape acts as a step in the solution, and the arrows represent the direction of flow among the steps.

 3.     Symbols used in a Flowchart

 


4.        Benefits of using a Flowchart

1. It helps to explain our approach towards solving a problem

2. It gives a visual clarity to a problem.

3. It helps in practical problem solving

4. If we need to understand the code, we can refer to the flowchart.

 

Simple Example of an Algorithm

Topic: Making a Sandwich

Algorithm Steps:

Step1:  Take two slices of bread.

Step2:  Spread butter on one slice.

Step3:  Put some jam on the other slice.

Step4:  Press both slices together.

Step5:  Serve the sandwich.


Simple Programming Example: 

Task: Add two numbers

Algorithm:

  1. Start
  2. Take two numbers (example: 5 and 3)
  3. Add the two numbers
  4. Show the result
  5. End

Simple Example of Flowchart

Topic: Making Maggi

  • Start (Oval)
  • Get Maggi, Masala & Water (Parallelogram – Input)
  • Boil water (Rectangle – Process)
  • Add Maggi & Tastemaker (Rectangle – Process)
  • Cook for 2 minutes (Rectangle – Process)
  • Serve in bowl (Rectangle – Process)
  • Eat / Serve hot (Parallelogram – Output)
  • End (Oval)

Simple Example of Flowchart

Topic: Add 2 numbers

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.