SS 2 COMPUTER SCIENCE WEEK 9 - 10: ALGORITHM AND FLOW CHART


 
ALGORITHM AND FLOW CHART
Algorithm and flowchart are two types of tools to explain the process of a program. Algorithms and flowcharts are two different tools used for creating new programs, especially in computer programming. An algorithm is a step-by-step analysis of the process, while a flowchart explains the steps of a program in a graphical way.

Definition of Algorithm
To write a logical step-by-step method to solve the problem is called algorithm, in other words, an algorithm is a procedure for solving problems. In order to solve a mathematical or computer problem, this is the first step of the procedure. An algorithm includes calculations, reasoning and data processing. Algorithms can be presented by natural languages, pseudo code and flowcharts, etc.

Definition of Flowchart
A flowchart is the graphical or pictorial representation of an algorithm with the help of different symbols, shapes and arrows in order to demonstrate a process or a program. With algorithms, we can easily understand a program. The main purpose of a flowchart is to analyze different processes. Several standard graphics are applied in a flowchart:



Flowchart symbols, Name and Functions

 
The graphics above represent different part of a flowchart. The process in a flowchart can be expressed through boxes and arrows with different sizes and colors. In a flowchart, we can easily highlight a certain element and the relationships between each part. 

How to Use Flowcharts to Represent Algorithms
Now that we have the definitions of algorithm and flowchart, how do we use a flowchart to represent an algorithm?

Algorithms are mainly used for mathematical and computer programs, whilst flowcharts can be used to describe all sorts of processes: business, educational, personal and of course algorithms. So flowcharts are often used as a program planning tool to visually organize the step-by-step process of a program. Here are some examples:

Example 1: Print 1 to 20:
Algorithm:
Step 1: Initialize X as 0,
Step 2: Increment X by 1,
Step 3: Print X,
Step 4: If X is less than 20 then go back to step 2.

Flowchart representation:


Example 2: 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,
Flowchart:

 
Conclusion
From the above we can come to a conclusion that a flowchart is pictorial representation of an algorithm, an algorithm can be expressed and analyzed through a flowchart.
An algorithm shows you every step of reaching the final solution, while a flowchart shows you how to carry out the process by connecting each step. An algorithm uses mainly words to describe the steps while a flowchart uses the help of symbols, shapes and arrows to make the process more logical.

Algorithm and its characteristics
A step-by-step method of solving a problem or making decisions, as in making a diagnosis. An established mechanical procedure for solving certain mathematical problems.
 
Properties of the algorithm
 Finiteness: An algorithm must always terminate after a finite number of steps.
Definiteness: Each step of an algorithm must be precisely defined; the actions to be carried out must be rigorously and unambiguously specified for each case.
Input: An algorithm has zero or more inputs, i.e, quantities which are given to it initially before the algorithm begins.
Output: An algorithm has one or more outputs i.e, quantities which have a specified relation to the inputs.
Effectiveness: An algorithm is also generally expected to be effective. This means that all of the operations to be performed in the algorithm must be sufficiently basic that they can in principle be done exactly and in a finite length of time.

CHARACTERISTICS OF A GOOD FLOWCHART
(i)            Should consist of standardized and acceptable symbols.
(ii)           The symbols should be correctly used according to flowcharts rules.
(iii)          Should have short, clear and readable statements written inside the symbols.
(iv)         It must have clear one starting point and one ending point.
(v)          Must flow in a logical order.
(vi)         Should have acceptable and common keywords such as READ, INPUT, PRINT or WRITE.
(vii)        Must have arrows indicating the flow of instructions.

ASSIGNMENT
1.      Draw a flowchart to calculate area of a triangle
2.      List 5 more characteristics of the flowchart as started in your HiiT TextBook.
 

Comments

  1. Thank you for some other informative website. The place else may just I get that kind of information written in such a perfect method? I have a venture that I am simply now running on, and I’ve been at the glance out for such info. https://www.desktopcon.org/best-computer-for-college-student/

    ReplyDelete
  2. There is so much in this article that I would never have thought of on my own. Your content gives readers things to think about in an interesting way. Thank you for your clear information. 15 hand-pciked Best Computer For College Student

    ReplyDelete
  3. Everything has its value. Thanks for sharing this informative information with us. GOOD works! https://pcworld.site

    ReplyDelete
  4. When your website or blog goes live for the first time, it is exciting. That is until you realize no one but you and your. hoverwatch coupon code

    ReplyDelete
  5. There is so much in this article that I would never have thought of on my own.Your content gives readers things to think about in an interesting way.Thank you for your clear information. Buy Innosilicon Grin miner

    ReplyDelete
  6. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. Laptop

    ReplyDelete
  7. Very informative blog!

    Please take some time to visit my blog @
    loop in C notes

    Thanks!

    ReplyDelete
  8. A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. algebra calculator

    ReplyDelete

Post a Comment

Popular posts from this blog

JSS 3 WEEK 4: INTERNET (SEARCH ENGINES)

JSS 3 - CHARTS AND GRAPHS

JSS 3 WEEK 7 - 8: HUMAN ISSUE