flowcharting and algorithm
TRANSCRIPT
Zeinna Belle C. Desamito
Melissa Mae B. Ibarra
9-SSC-Lavoisier
and
A computer is a useful tool for solving agreat variety of problems. To make a computerdo anything, you have to write a computerprogram. In a computer you tell a computer,step by step, exactly what you want it do. Thecomputer then executes the program, followingeach step mechanically, to accomplish the endgoal.
Look around you. Computers and networks areeverywhere. In mathematics and computer science analgorithm is a finite sequence of step expressed forsolving a problem. An algorithm can be defined as “aprocess that performs some sequence of operation inorder to solve a given problem”. Algorithms are used forcalculation, data processing and many other fields. Agood algorithm is like using the right tool in theworkshop. It does the job with the right amount ofeffort.
Algorithms can be expressed in many different notations,including pseudocode, flowchart and programming languages.Pseudocode and flowcharts are structured ways to expressalgorithms. Programming languages are primarily intended forexpressing algorithms in a form that can be executed by a computer,but are often used to define or document algorithms. Sometimes it ishelpful in the description of an algorithm to supplement smallflowcharts with natural language and/or arithmetic expressionswritten inside block diagrams to summarize what the flowcharts areaccomplishing.
The use of algorithm provides a number ofbenefits. By using an algorithm, decision makingbecomes more rational. Problems that would bedifficult to solve in entirely can be answered easilyas small series. An algorithm serves as a mnemonicdevice and helps ensure that variables or parts ofthe problem are not ignored.
A flowchart is a type of diagram (graphical or symbolic) thatrepresents an algorithm or process. Each step in process isrepresented by a different symbol and contains a short descriptionof the process step.
A flowchart describes what operations are required to solvea given problem.
Flowcharts are used in analyzing, designing, documenting,or managing a process or program in various fields.
To communicate with others how a process is done.
A flowchart is generally used when a new project begins in
order to plan for the project.
A flowchart helps to clarify how things are currently working
and how they could be improved.
Flowcharts also uncover steps that are redundant or
misplaced.
Picture Shape Name ActionRepresented
Oval Terminal Symbol Represents startand end of program
Parallelogram Input/Output Indicates input and output
Rectangle Process This representsprocessing of action.e.g. mathematical operator
Diamond Decision Since computer only answer the question yes/no, this is used to represent logical test for the program.
Hexagon Initialization/Preparation
This is used to preparememory for repetition of an action.
Arrow Lines & ArrowHeads
Direction This shows the flow of the program
Annotation This is used to describe action or variable.
Circle On page connector This is used to show connector or part of program to another part.
Pentagon Off- page connnector This is used to connect part of a program to another part on the other page or paper.
These are the basic symbols used generally.Now, the basic guidelines for drawing a flowchartwith the above symbols are that:
In drawing a proper flowchart, all necessary requirements
should be listed out in logical order.
The flowchart is to be read left to right or top to bottom.
A process symbol can have only one flow line coming out of it.
For a decision symbol, only one flow line can enter it, but
multiple lines can leave it to denote possible answers.
The terminal symbols can only have one flow line in
conjunction with them.
Sequence of a Flowchart
• Design a flowchart that will accept and display a number. Write its equivalent algorithms.
Algorithm:
Step 1. Read in the value of N.
Step 2. Print the value of N.
START
Read N
Print N
END
• Construct a flowchart that will compute andprint the sum of and average of 3 numbers.Write each equivalent algorithm.
Algorithm:
Step 1: Inizialization of the sum and average into 0.
Step 2: Input a,b,cStep 3: Compute sum by adding a,b, and c then compute the average by dividing the sum of a,b and c by 3
Step 4: Print the computed sum and average
START
SUM=0
READ A,B, C
Print Sum, Average
ENDSUM= A+B+CAVERAGE = (A+B+C)/3
•Draw a flowchart that computes and prints the area of a rectangle. Write each
equivalent algorithm.
Algorithm:
1. Initialize Area into a
2. Input the value of length and width
3. Compute for the area
4. Print the area
START
A = 0
Input lw
A = l*w Print A END
• Construct flowchart that will compute & print the sum and average of a 4th gr.
periods. Write its algorithm.
• Construct a flowchart that will compute and print the sum of and average of 2 numbers. Write each
equivalent algorithm.
Algorithm is the sequence of steps to be performed in order to solve a problem by the computer.
Algorithms can be expressed in many different notations, including pseudocode, flowchart and programming languages.
Programming languages are primarily intended for expressing algorithms in a form that can be executed by a computer, but are often used to define or document algorithms.
A flowchart is a type of diagram (graphical or symbolic) that represents an algorithm or process. Each step in process is represented by a different symbol and contains a short description of the process step.
Flowcharts are used in analyzing, designing, documenting, or managing a process or program in various fields.