SlideShare a Scribd company logo
1 of 42
Download to read offline
Studocu is not sponsored or endorsed by any college or university
Algorithm and Flowcharting
BS Civil Engineering (Polytechnic University of the Philippines)
Studocu is not sponsored or endorsed by any college or university
Algorithm and Flowcharting
BS Civil Engineering (Polytechnic University of the Philippines)
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Lecture in
Algorithm and Flowcharting
COMPFUND
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Phases of SDLC
System Development Life Cycle
◼Preliminary Investigation
◼Analysis
◼Design
◼Development
◼Implementation
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Activities Involve in
Programming
◼ Understand the problem.
◼ Plan the logic.
◼ Code the program.
◼ Compile the program into machine
language.
◼ Test the program.
◼ Put the program into production.
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Activities involve in
Programming
Understanding the Problem
◼ Before writing the program the programmer must first
understand the problem.
◼ Satisfy the user’s need
◼ One of the most difficult task since description of what
is needed may be vague, or worse yet, the user may
not even know what he/she wants.
◼ A good programmer is part counselor, and part
detective.
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Activities Involve in
Programming
Plan the Logic
The process of planning for the solution of the
problem.
◼They are referred to as “ALGORITHMS”
◼Two most common tools are FLOWCHARTS and
PSEUDOCODE.
◼ Involves writing down steps (in English).
◼ The programmer doesn’t worry about syntax at this
point, just the sequence of events that will lead from
available input to the desired output.
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Activities Involve in
Programming
Code the Program
◼ There are over 400 programming languages that
exist.
◼Most programming languages have translators
also known as compiler and interpreters.
◼Pascal, C, C++, Visual Basic, Cobol, etc.
◼ The part in which the programmer worry about the
correct syntax; command, punctuation, spelling, etc.
◼ The actual construction of the source code.
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Activities involve in
Programming
Compile the program into Machine Language
◼ Machine language - the only language a machine
knows.
◼Its consists of 0’s and 1’s.
◼ Compiler is a special program that translates high-level
language instructions into machine language.
◼ Compiler catches all syntax errors.
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Activities involve in
Programming
Test the Program
◼ Check for logical errors.
◼ The use of sample data to see whether the
programming is running properly.
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Activities involve in
Programming
Put the Program into Production
◼ The organization can now use the program.
◼ Training personnel to use the program.
◼ Running the program using the actual data.
◼ Test for user’s approval.
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Algorithm
◼ A sequence of well-understood steps that one takes to
do something.
◼ A set of instructions for a person to follow in order to
accomplish a certain task.
◼ A sequence of instructions that tell how to solve a
particular problem.
◼ It is a finite set of instructions that specify a sequence of
operations to be carried out in order to solve a specific
problem or class of problems.
◼ Examples:
◼ directions for going to a certain place
◼ baking a chocolate cake
◼ computing income tax
◼ searching for a name in a telephone directory
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Example:
Prepare a Cup of Coffee
◼ Step 1: Fill kettle with water.
◼ Step 2: Turn on stove.
◼ Step 3: Put kettle on stove.
◼ Step 4: If water is boiling proceed to step#5 otherwise wait.
◼ Step 5: Turn off stove
◼ Step 6: Fill mug with boiled water
◼ Step 7: Put 1 tsp. of coffee in mug.
◼ Step 8: With sugar, put 2 tsp. of sugar in mug, otherwise proceed
to step#9.
◼ Step 9: With milk, pour 1 tbsp. of milk in mug, otherwise proceed to
step#10.
◼ Step 10: Stir contents of mug
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Characteristics of an Algorithm
◼ Specify each step or instruction exactly.
◼There must be no ambiguity.
◼The instructions must be clear.
◼ There must be a finite number of steps.
◼The algorithm must terminate.
◼There must be a stopping point.
◼ There must be an output.
◼The algorithm must produce the correct result.
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Flowcharting
What is Flowcharting?
◼ A graphical representation of the logical steps that solves a
problem.
◼ Programmers use flowcharts to understand the logic
processing of data.
◼ To visualize how statements in a program are interrelated.
◼ Although time consuming, it’s the best tool for beginners.
◼ Use of symbol and phrases to designate the logic of how a
problem solved.
◼ A common method for defining the logical steps of flow within a
program by using a series of symbols to identify the basic
input, process and output (IPO’s) function within a program.
◼ A diagram representing the logical sequence in which a
combination of steps or operation is to be performed. It is a
blueprint of the program.
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Flowcharting
Types of Flowcharts
◼ Program Flowcharts
◼Depicts the detailed logical flow of process in a program.
◼ System Flowcharts
◼Shows the logic flow of data from one source to another.
◼Divided into functions of departments or personnel.
◼Symbols are used to represent documents used and
operations undertaken.
◼Highlights excessive information flow, duplication of
information stored in different locations and reasons for
delay of transactions.
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Basic Flowcharting Symbols
Terminal block
Input/Output block
Process symbol
Decision symbol
On-page Connector
Off-page Connector
Initialization symbol
Flow lines
Flowcharting
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Basic Flowcharting Symbols
◼ Terminal
- used to signify the beginning
and end of flowchart
Flowcharting
OVAL
START
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Basic Flowcharting Symbols
◼ Preparation/Initialization
- signifies the preparation of data
- Used to select initial conditions
- Used to represent instructions or
group of instructions that will
alter or modify a programs
course of execution
Flowcharting
Hexagon
SUM=0
PRODUCT=0
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Basic Flowcharting Symbols
◼ Input/Output
-shows input and output.
Data are to be read into the
computer memory from an
input device or data are to
be passed from the memory
to an output device.
Flowcharting
Parallelogram
Read A
Print A
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Basic Flowcharting Symbols
◼ Process/Processing
-performs any calculations hat
are to be done.
Flowcharting
Rectangle
Sum = A+B
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Basic Flowcharting Symbols
◼ Decision
-signifies any decisions that are to
be done. Two alternative
execution paths are possible.
The path to be followed is
selected during the execution by
testing whether or not the
condition specified within the
outline is fulfilled.
Flowcharting
Diamond
If x>5
T F
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Basic Flowcharting Symbols
◼ On-page Connector
-show the entry or exit point of the
flowchart. A non-processing
symbol used to connect one part
of a flowchart to another without
drawing flowlines. Conserves
space by keeping related blocks
near one another, reduces the
number of flowlines in complex
program and eliminates cross
lines from taking place.
Flowcharting
A
Small Circle
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Basic Flowcharting Symbols
◼ Off-page Connector
-designates entry or to exit
from one page when a
flowchart requires more
than one page.
Flowcharting
Pentagon
B
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Basic Flowcharting Symbols
◼ Flowlines
-signifies the process that is
to be executed next
Flowcharting
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Basic Flowcharting
◼ Almost every program involves the steps of input,
processing and output.
◼Example:
Get number
Answer = number *2
Print Answer
◼ Most flowcharts need some way to separate each step.
◼ Drawing different boxes around each statement is the
standard convention.
◼ Input operation are represented in a parallelogram. A
statement in English is written inside the parallelogram.
Flowcharting
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
What are Variables?
◼ Memory allocations, the content of which may vary/change.
◼ The capability of memory variables to change its content
makes the computers and programming worthwhile.
◼ Because one memory location can be used over and over
again with different values, program instructions can be
written once and then used for thousands of problems.
◼ Giving names (for identification) may vary from one
programming language to another; some may allow
hyphens; others allows underscores; some languages allow
dollar signs, others don’t. There are languages that limits the
length of names to a variable.
Flowcharting
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Rules in naming variables...
◼ Must be one word.
◼ May contain letters, numbers, hyphens,
underscores.
◼ Must not start with a number.
◼ Must not contain a space.
◼ Must have some meaning.
Invalid Variable names
 interest rate - should be one word
 rate! - contains ! an invalid character
 xyxxx - although this is allowed, it doesn’t mean
or imply anything that it may hold.
 #total - should not start with a special character.
Flowcharting
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Types of Variables
◼ Numeric Variables
◼ The type of variable that can hold a number.
◼ In this example: Answer = number * 2
◼ Some languages allow additional types of data; Pascal and C
distinguish between integer or whole number numeric variables and
floating point, decimal and fractional numeric variables.
◼ Character, Text or String Variables
◼ Variables that can hold letters of the alphabet and other special
character such as punctuation marks.
◼ Example:
NAME = “WASHINGTON”
◼ Logical or Boolean Variables
◼ A special type of variable that can only have two values - TRUE or
FALSE.
Flowcharting
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Arithmetic Operators and Mathematical Statements
◼ Addition (+)
◼ Subtraction (-)
◼ Multiplication (*)
◼ Division (/)
◼ Modulus (%)
◼ A mathematical statement is composed of a left variable, an
assignment operator (usually in the form of an equal sign) a
series of operands(may be a set of the same variables or a new
set of variables, and /or constants) and (arithmetic) operators.
◼ Example:
x = x + 1
sum = a + b
Flowcharting
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Constants
◼ A constant is a value that never changes during the
execution of the program.
◼ Constants can be any type-numeric, alphabetic or
special symbols.
◼ Like variable, constants can be named. The computer
sets up a specific memory location to hold the value of
the constant.
◼ During the execution of the program, the constant is
referred to by name. Once the constant is given a
value, it cannot be changed during the execution of
the program.
Flowcharting
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Relational Operator
◼ A relational operator compares two values and
determines the relationship between them.
Operator Use Returns true if
> op1 > op2 op1 is greater than op2
>= op1 >= op2 op1 is greater than or equal to op2
< op1 < op2 op1 is less than op2
<= op1 <= op2 op1 is less than or equal to op2
== op1 == op2 op1 and op2 are equal
!= / not= op1 != op2 op1 and op2 are not equal
op1 not= op2
Flowcharting
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Logical Operators
◼ Use logical operators (also called Boolean operators) to
express relationships between search expressions.
Operator Use Returns true if
and cond1 and cond2 both condition should be true
or cond1 or cond2 either one of the condition is true
not (negation) not cond
! cond
Flowcharting
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
ADVANTAGES OF USING
FLOWCHARTS
1. Communication: Flowcharts are better way of communicating the logic
of a system to all concerned.
2. Effective analysis: With the help of flowchart, problem can be analyzed
in more effective way.
3. Proper documentation: Program flowcharts serve as a good program
documentation, which is needed for various purposes.
4. Efficient Coding: The flowcharts act as a guide or blueprint during the
systems analysis and program development phase.
5. Proper Debugging: The flowchart helps in debugging process.
6. Efficient Program Maintenance: The maintenance of operating program
becomes easy with the help of flowchart. It helps the programmer to put
efforts more efficiently on that part
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
LIMITATIONS OF USING
FLOWCHARTS
1. Complex logic: Sometimes, the program logic is quite
complicated. In that case, flowchart becomes complex and
clumsy.
2. Alterations and Modifications: If alterations are required
the flowchart may require re-drawing completely.
3. Reproduction: As the flowchart symbols cannot be typed,
reproduction of flowchart becomes a problem.
4. The essentials of what is done can easily be lost in the
technical details of how it is done.
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Draw 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
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Draw a flowchart that will compute and display the sum and
product of two numbers. Write its equivalent algorithm.
Algorithm:
Step 1: Initialize Sum and Product
into 0.
Step 2: Read in the values of A and
B.
Step 3: Compute the sum by
adding A and B then compute the
product by multiplying A and B.
Step 4: Print the computed value of
Sum and Product.
START
Read A,B
Print Sum,
Product
END
Sum = 0
Product = 0
Sum = A + B
Product = A * B
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Construct a flowchart that will convert an inputted number in
Fahrenheit to its equivalent measure in Celsius.
Formula: C = (5/9)*(F-32)
Algorithm:
Step 1: Initialize Celsius into 0.
Step 2: Read in the value of
Fahrenheit.
Step 3: Compute the value of
Celsius.
Step 4: Print the computed value of
Celsius.
START
Read Fah
Print
Celsius
END
Celsius=0
Celsius=(5/9)*
(Fah-32)
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Draw a flowchart that will input values for A and B. Compare two
values inputted and print which of the values is higher including the
remark “Higher”. Write its equivalent algorithm.
Algorithm:
Step 1: Read the values of A and B.
Step 2: Test if A is greater than B.
Step 3: If A is greater than B, A is higher.
However, if A is less than B, B is higher.
Step 4: Print the number and the remark
“Higher”
START
Input A,B
Print A,
“Higher”
END
A > B
Print B,
“Higher”
T
F
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Draw a flowchart that will input grade of student and determine
whether the grade is passed or failed. Print the name, grade and
remarks of student. Write its equivalent algorithm.
Algorithm:
Step 1: Initialize name and remarks into blanks.
Step 2: Read in values for Grade and Name.
Step 3: Test if Grade is greater than or equal to 60.
Step 4: If Grade is greater than or equal to 60,
remark is “Passed”. However, if Grade is below
60, remark is “Failed”.
Step 5: Print the name, grade and remarks.
START
Read Name,
Grade
END
If Grade
>60
Print Name,
Grade, Remarks
Name=“ “
Remarks = “ “
Remarks =
“Failed”
Remarks =
“Passed”
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
SEATWORK
◼ DEI Manufacturing Company plans to give a year-
end bonus to each of its employee. Draw a
flowchart which will compute the bonus of an
employee. Consider the following conditions: If
the employee’s monthly salary is less than 2,000
pesos, the bonus is 50% of the salary; for
employees with salaries greater than 2,000 pesos,
the bonus is 1,500 pesos. Print the name and the
corresponding bonus for each employee. Write
each equivalent algorithms.
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Pseudocode
◼ uses everyday language to prepare a brief set of instructions
in the order in which they will appear in the finished program.
◼ It is an abbreviated version of actual computer code (that's
why it is called pseudocode).
◼ Pseudocode looks more like a real program than the flowchart
does. It allows the programmer to focus on the steps required
to solve a program rather than on how to use the computer
language.
◼ An advantage of pseudocode is that it can be used to
describe a program to a nontechnical user and can still
provide guidelines for the writing of program code.
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794
Pseudocode
◼ A textual presentation of a flowchart
◼ Close to a natural language
◼ The control structures impose the logic
◼ May become a part of the program documentation
◼ Could be translated into a program
Downloaded by nuevo dennis (atgimil@gmail.com)
lOMoARcPSD|32539794

More Related Content

Similar to algorithm-and-flowcharting.pdf

The End of Data Entry: Liberate Your Organization Through Automation and Inte...
The End of Data Entry: Liberate Your Organization Through Automation and Inte...The End of Data Entry: Liberate Your Organization Through Automation and Inte...
The End of Data Entry: Liberate Your Organization Through Automation and Inte...CAMT
 
Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022
Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022
Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022HostedbyConfluent
 
Apache Flink Worst Practices
Apache Flink Worst PracticesApache Flink Worst Practices
Apache Flink Worst PracticesKonstantin Knauf
 
2019 session 6 develop programs to solve a variety of problems in math , phys...
2019 session 6 develop programs to solve a variety of problems in math , phys...2019 session 6 develop programs to solve a variety of problems in math , phys...
2019 session 6 develop programs to solve a variety of problems in math , phys...Osama Ghandour Geris
 
L1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdfL1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdfMMRF2
 
Scrum first impressions
Scrum first impressionsScrum first impressions
Scrum first impressionsCésar Pardo
 
1 Introduction to Computers and Programming Language
1 Introduction to Computers and Programming Language1 Introduction to Computers and Programming Language
1 Introduction to Computers and Programming LanguageKwan Lee
 
Machine Data Is EVERYWHERE: Use It for Testing
Machine Data Is EVERYWHERE: Use It for TestingMachine Data Is EVERYWHERE: Use It for Testing
Machine Data Is EVERYWHERE: Use It for TestingTechWell
 
Why do you Need to Migrate to Salesforce Flow?, Andrew Cook
Why do you Need to Migrate to Salesforce Flow?, Andrew CookWhy do you Need to Migrate to Salesforce Flow?, Andrew Cook
Why do you Need to Migrate to Salesforce Flow?, Andrew CookCzechDreamin
 
Dask and Machine Learning Models in Production - PyColorado 2019
Dask and Machine Learning Models in Production - PyColorado 2019Dask and Machine Learning Models in Production - PyColorado 2019
Dask and Machine Learning Models in Production - PyColorado 2019William Cox
 
Development and deployment of polyglot systems
Development and deployment of polyglot systemsDevelopment and deployment of polyglot systems
Development and deployment of polyglot systemsDavid Pichsenmeister
 
CC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbg
CC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbgCC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbg
CC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbgmudzabbilani
 
Bti1022 lab sheet 3
Bti1022 lab sheet 3Bti1022 lab sheet 3
Bti1022 lab sheet 3alish sha
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsnoahjamessss
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringscskvsmi44
 
How to create_an_ecatt
How to create_an_ecattHow to create_an_ecatt
How to create_an_ecattMohammed Azhad
 
Turning the web stack upside down rethinking how data flows through systems
Turning the web stack upside down  rethinking how data flows through systemsTurning the web stack upside down  rethinking how data flows through systems
Turning the web stack upside down rethinking how data flows through systemsPaolo Negri
 
Beyond unit tests: Deployment and testing for Hadoop/Spark workflows
Beyond unit tests: Deployment and testing for Hadoop/Spark workflowsBeyond unit tests: Deployment and testing for Hadoop/Spark workflows
Beyond unit tests: Deployment and testing for Hadoop/Spark workflowsDataWorks Summit
 

Similar to algorithm-and-flowcharting.pdf (20)

The End of Data Entry: Liberate Your Organization Through Automation and Inte...
The End of Data Entry: Liberate Your Organization Through Automation and Inte...The End of Data Entry: Liberate Your Organization Through Automation and Inte...
The End of Data Entry: Liberate Your Organization Through Automation and Inte...
 
Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022
Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022
Buckle Up! With Valerie Burchby and Xinran Waibe | Current 2022
 
Simulation lab
Simulation labSimulation lab
Simulation lab
 
COMPUTER PROGRAMMING
COMPUTER PROGRAMMINGCOMPUTER PROGRAMMING
COMPUTER PROGRAMMING
 
Apache Flink Worst Practices
Apache Flink Worst PracticesApache Flink Worst Practices
Apache Flink Worst Practices
 
2019 session 6 develop programs to solve a variety of problems in math , phys...
2019 session 6 develop programs to solve a variety of problems in math , phys...2019 session 6 develop programs to solve a variety of problems in math , phys...
2019 session 6 develop programs to solve a variety of problems in math , phys...
 
L1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdfL1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdf
 
Scrum first impressions
Scrum first impressionsScrum first impressions
Scrum first impressions
 
1 Introduction to Computers and Programming Language
1 Introduction to Computers and Programming Language1 Introduction to Computers and Programming Language
1 Introduction to Computers and Programming Language
 
Machine Data Is EVERYWHERE: Use It for Testing
Machine Data Is EVERYWHERE: Use It for TestingMachine Data Is EVERYWHERE: Use It for Testing
Machine Data Is EVERYWHERE: Use It for Testing
 
Why do you Need to Migrate to Salesforce Flow?, Andrew Cook
Why do you Need to Migrate to Salesforce Flow?, Andrew CookWhy do you Need to Migrate to Salesforce Flow?, Andrew Cook
Why do you Need to Migrate to Salesforce Flow?, Andrew Cook
 
Dask and Machine Learning Models in Production - PyColorado 2019
Dask and Machine Learning Models in Production - PyColorado 2019Dask and Machine Learning Models in Production - PyColorado 2019
Dask and Machine Learning Models in Production - PyColorado 2019
 
Development and deployment of polyglot systems
Development and deployment of polyglot systemsDevelopment and deployment of polyglot systems
Development and deployment of polyglot systems
 
CC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbg
CC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbgCC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbg
CC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbg
 
Bti1022 lab sheet 3
Bti1022 lab sheet 3Bti1022 lab sheet 3
Bti1022 lab sheet 3
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
How to create_an_ecatt
How to create_an_ecattHow to create_an_ecatt
How to create_an_ecatt
 
Turning the web stack upside down rethinking how data flows through systems
Turning the web stack upside down  rethinking how data flows through systemsTurning the web stack upside down  rethinking how data flows through systems
Turning the web stack upside down rethinking how data flows through systems
 
Beyond unit tests: Deployment and testing for Hadoop/Spark workflows
Beyond unit tests: Deployment and testing for Hadoop/Spark workflowsBeyond unit tests: Deployment and testing for Hadoop/Spark workflows
Beyond unit tests: Deployment and testing for Hadoop/Spark workflows
 

Recently uploaded

Guide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWNGuide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWNBruce Bennett
 
obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...
obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...
obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...yulianti213969
 
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaon
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime MalegaonVip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaon
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaonmeghakumariji156
 
Call Girl In Gwalior Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class C...
Call Girl In Gwalior Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class C...Call Girl In Gwalior Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class C...
Call Girl In Gwalior Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class C...vershagrag
 
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证eqaqen
 
Specialize in a MSc within Biomanufacturing, and work part-time as Process En...
Specialize in a MSc within Biomanufacturing, and work part-time as Process En...Specialize in a MSc within Biomanufacturing, and work part-time as Process En...
Specialize in a MSc within Biomanufacturing, and work part-time as Process En...Juli Boned
 
Personal Brand Exploration ppt.- Ronnie Jones
Personal Brand  Exploration ppt.- Ronnie JonesPersonal Brand  Exploration ppt.- Ronnie Jones
Personal Brand Exploration ppt.- Ronnie Jonesjonesyde302
 
Top profile Call Girls In Etawah [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Etawah [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Etawah [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Etawah [ 7014168258 ] Call Me For Genuine Models We...nirzagarg
 
K Venkat Naveen Kumar | GCP Data Engineer | CV
K Venkat Naveen Kumar | GCP Data Engineer | CVK Venkat Naveen Kumar | GCP Data Engineer | CV
K Venkat Naveen Kumar | GCP Data Engineer | CVK VENKAT NAVEEN KUMAR
 
B.tech Civil Engineering Major Project by Deepak Kumar ppt.pdf
B.tech Civil Engineering Major Project by Deepak Kumar ppt.pdfB.tech Civil Engineering Major Project by Deepak Kumar ppt.pdf
B.tech Civil Engineering Major Project by Deepak Kumar ppt.pdfDeepak15CivilEngg
 
Ganga Path Project (marine drive project) Patna ,Bihar .pdf
Ganga Path Project (marine drive project) Patna ,Bihar .pdfGanga Path Project (marine drive project) Patna ,Bihar .pdf
Ganga Path Project (marine drive project) Patna ,Bihar .pdfDeepak15CivilEngg
 
Kannada Call Girls Mira Bhayandar WhatsApp +91-9930687706, Best Service
Kannada Call Girls Mira Bhayandar WhatsApp +91-9930687706, Best ServiceKannada Call Girls Mira Bhayandar WhatsApp +91-9930687706, Best Service
Kannada Call Girls Mira Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
Call Girls In GOA North Goa +91-8588052666 Direct Cash Escorts Service
Call Girls In GOA North Goa +91-8588052666 Direct Cash Escorts ServiceCall Girls In GOA North Goa +91-8588052666 Direct Cash Escorts Service
Call Girls In GOA North Goa +91-8588052666 Direct Cash Escorts Servicenishakur201
 
207095666-Book-Review-on-Ignited-Minds-Final.pptx
207095666-Book-Review-on-Ignited-Minds-Final.pptx207095666-Book-Review-on-Ignited-Minds-Final.pptx
207095666-Book-Review-on-Ignited-Minds-Final.pptxpawangadkhe786
 
Eden Gardens * High Profile Call Girls in Kolkata Phone No 8005736733 Elite E...
Eden Gardens * High Profile Call Girls in Kolkata Phone No 8005736733 Elite E...Eden Gardens * High Profile Call Girls in Kolkata Phone No 8005736733 Elite E...
Eden Gardens * High Profile Call Girls in Kolkata Phone No 8005736733 Elite E...HyderabadDolls
 
DMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdf
DMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdfDMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdf
DMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdfReemaKhan31
 
Call Girl Service in Ahmednagar { 9332606886 } VVIP NISHA Call Girls Near 5 S...
Call Girl Service in Ahmednagar { 9332606886 } VVIP NISHA Call Girls Near 5 S...Call Girl Service in Ahmednagar { 9332606886 } VVIP NISHA Call Girls Near 5 S...
Call Girl Service in Ahmednagar { 9332606886 } VVIP NISHA Call Girls Near 5 S...Sareena Khatun
 
Top profile Call Girls In bhubaneswar [ 7014168258 ] Call Me For Genuine Mode...
Top profile Call Girls In bhubaneswar [ 7014168258 ] Call Me For Genuine Mode...Top profile Call Girls In bhubaneswar [ 7014168258 ] Call Me For Genuine Mode...
Top profile Call Girls In bhubaneswar [ 7014168258 ] Call Me For Genuine Mode...gajnagarg
 
UXPA Boston 2024 Maximize the Client Consultant Relationship.pdf
UXPA Boston 2024 Maximize the Client Consultant Relationship.pdfUXPA Boston 2024 Maximize the Client Consultant Relationship.pdf
UXPA Boston 2024 Maximize the Client Consultant Relationship.pdfDan Berlin
 
Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...gajnagarg
 

Recently uploaded (20)

Guide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWNGuide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWN
 
obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...
obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...
obat aborsi pacitan wa 081336238223 jual obat aborsi cytotec asli di pacitan0...
 
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaon
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime MalegaonVip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaon
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaon
 
Call Girl In Gwalior Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class C...
Call Girl In Gwalior Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class C...Call Girl In Gwalior Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class C...
Call Girl In Gwalior Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class C...
 
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
一比一定(购)中央昆士兰大学毕业证(CQU毕业证)成绩单学位证
 
Specialize in a MSc within Biomanufacturing, and work part-time as Process En...
Specialize in a MSc within Biomanufacturing, and work part-time as Process En...Specialize in a MSc within Biomanufacturing, and work part-time as Process En...
Specialize in a MSc within Biomanufacturing, and work part-time as Process En...
 
Personal Brand Exploration ppt.- Ronnie Jones
Personal Brand  Exploration ppt.- Ronnie JonesPersonal Brand  Exploration ppt.- Ronnie Jones
Personal Brand Exploration ppt.- Ronnie Jones
 
Top profile Call Girls In Etawah [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Etawah [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Etawah [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Etawah [ 7014168258 ] Call Me For Genuine Models We...
 
K Venkat Naveen Kumar | GCP Data Engineer | CV
K Venkat Naveen Kumar | GCP Data Engineer | CVK Venkat Naveen Kumar | GCP Data Engineer | CV
K Venkat Naveen Kumar | GCP Data Engineer | CV
 
B.tech Civil Engineering Major Project by Deepak Kumar ppt.pdf
B.tech Civil Engineering Major Project by Deepak Kumar ppt.pdfB.tech Civil Engineering Major Project by Deepak Kumar ppt.pdf
B.tech Civil Engineering Major Project by Deepak Kumar ppt.pdf
 
Ganga Path Project (marine drive project) Patna ,Bihar .pdf
Ganga Path Project (marine drive project) Patna ,Bihar .pdfGanga Path Project (marine drive project) Patna ,Bihar .pdf
Ganga Path Project (marine drive project) Patna ,Bihar .pdf
 
Kannada Call Girls Mira Bhayandar WhatsApp +91-9930687706, Best Service
Kannada Call Girls Mira Bhayandar WhatsApp +91-9930687706, Best ServiceKannada Call Girls Mira Bhayandar WhatsApp +91-9930687706, Best Service
Kannada Call Girls Mira Bhayandar WhatsApp +91-9930687706, Best Service
 
Call Girls In GOA North Goa +91-8588052666 Direct Cash Escorts Service
Call Girls In GOA North Goa +91-8588052666 Direct Cash Escorts ServiceCall Girls In GOA North Goa +91-8588052666 Direct Cash Escorts Service
Call Girls In GOA North Goa +91-8588052666 Direct Cash Escorts Service
 
207095666-Book-Review-on-Ignited-Minds-Final.pptx
207095666-Book-Review-on-Ignited-Minds-Final.pptx207095666-Book-Review-on-Ignited-Minds-Final.pptx
207095666-Book-Review-on-Ignited-Minds-Final.pptx
 
Eden Gardens * High Profile Call Girls in Kolkata Phone No 8005736733 Elite E...
Eden Gardens * High Profile Call Girls in Kolkata Phone No 8005736733 Elite E...Eden Gardens * High Profile Call Girls in Kolkata Phone No 8005736733 Elite E...
Eden Gardens * High Profile Call Girls in Kolkata Phone No 8005736733 Elite E...
 
DMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdf
DMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdfDMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdf
DMER-AYUSH-MIMS-Staff-Nurse-_Selection-List-04-05-2024.pdf
 
Call Girl Service in Ahmednagar { 9332606886 } VVIP NISHA Call Girls Near 5 S...
Call Girl Service in Ahmednagar { 9332606886 } VVIP NISHA Call Girls Near 5 S...Call Girl Service in Ahmednagar { 9332606886 } VVIP NISHA Call Girls Near 5 S...
Call Girl Service in Ahmednagar { 9332606886 } VVIP NISHA Call Girls Near 5 S...
 
Top profile Call Girls In bhubaneswar [ 7014168258 ] Call Me For Genuine Mode...
Top profile Call Girls In bhubaneswar [ 7014168258 ] Call Me For Genuine Mode...Top profile Call Girls In bhubaneswar [ 7014168258 ] Call Me For Genuine Mode...
Top profile Call Girls In bhubaneswar [ 7014168258 ] Call Me For Genuine Mode...
 
UXPA Boston 2024 Maximize the Client Consultant Relationship.pdf
UXPA Boston 2024 Maximize the Client Consultant Relationship.pdfUXPA Boston 2024 Maximize the Client Consultant Relationship.pdf
UXPA Boston 2024 Maximize the Client Consultant Relationship.pdf
 
Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In godhra [ 7014168258 ] Call Me For Genuine Models We...
 

algorithm-and-flowcharting.pdf

  • 1. Studocu is not sponsored or endorsed by any college or university Algorithm and Flowcharting BS Civil Engineering (Polytechnic University of the Philippines) Studocu is not sponsored or endorsed by any college or university Algorithm and Flowcharting BS Civil Engineering (Polytechnic University of the Philippines) Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 2. Lecture in Algorithm and Flowcharting COMPFUND Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 3. Phases of SDLC System Development Life Cycle ◼Preliminary Investigation ◼Analysis ◼Design ◼Development ◼Implementation Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 4. Activities Involve in Programming ◼ Understand the problem. ◼ Plan the logic. ◼ Code the program. ◼ Compile the program into machine language. ◼ Test the program. ◼ Put the program into production. Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 5. Activities involve in Programming Understanding the Problem ◼ Before writing the program the programmer must first understand the problem. ◼ Satisfy the user’s need ◼ One of the most difficult task since description of what is needed may be vague, or worse yet, the user may not even know what he/she wants. ◼ A good programmer is part counselor, and part detective. Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 6. Activities Involve in Programming Plan the Logic The process of planning for the solution of the problem. ◼They are referred to as “ALGORITHMS” ◼Two most common tools are FLOWCHARTS and PSEUDOCODE. ◼ Involves writing down steps (in English). ◼ The programmer doesn’t worry about syntax at this point, just the sequence of events that will lead from available input to the desired output. Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 7. Activities Involve in Programming Code the Program ◼ There are over 400 programming languages that exist. ◼Most programming languages have translators also known as compiler and interpreters. ◼Pascal, C, C++, Visual Basic, Cobol, etc. ◼ The part in which the programmer worry about the correct syntax; command, punctuation, spelling, etc. ◼ The actual construction of the source code. Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 8. Activities involve in Programming Compile the program into Machine Language ◼ Machine language - the only language a machine knows. ◼Its consists of 0’s and 1’s. ◼ Compiler is a special program that translates high-level language instructions into machine language. ◼ Compiler catches all syntax errors. Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 9. Activities involve in Programming Test the Program ◼ Check for logical errors. ◼ The use of sample data to see whether the programming is running properly. Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 10. Activities involve in Programming Put the Program into Production ◼ The organization can now use the program. ◼ Training personnel to use the program. ◼ Running the program using the actual data. ◼ Test for user’s approval. Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 11. Algorithm ◼ A sequence of well-understood steps that one takes to do something. ◼ A set of instructions for a person to follow in order to accomplish a certain task. ◼ A sequence of instructions that tell how to solve a particular problem. ◼ It is a finite set of instructions that specify a sequence of operations to be carried out in order to solve a specific problem or class of problems. ◼ Examples: ◼ directions for going to a certain place ◼ baking a chocolate cake ◼ computing income tax ◼ searching for a name in a telephone directory Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 12. Example: Prepare a Cup of Coffee ◼ Step 1: Fill kettle with water. ◼ Step 2: Turn on stove. ◼ Step 3: Put kettle on stove. ◼ Step 4: If water is boiling proceed to step#5 otherwise wait. ◼ Step 5: Turn off stove ◼ Step 6: Fill mug with boiled water ◼ Step 7: Put 1 tsp. of coffee in mug. ◼ Step 8: With sugar, put 2 tsp. of sugar in mug, otherwise proceed to step#9. ◼ Step 9: With milk, pour 1 tbsp. of milk in mug, otherwise proceed to step#10. ◼ Step 10: Stir contents of mug Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 13. Characteristics of an Algorithm ◼ Specify each step or instruction exactly. ◼There must be no ambiguity. ◼The instructions must be clear. ◼ There must be a finite number of steps. ◼The algorithm must terminate. ◼There must be a stopping point. ◼ There must be an output. ◼The algorithm must produce the correct result. Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 14. Flowcharting What is Flowcharting? ◼ A graphical representation of the logical steps that solves a problem. ◼ Programmers use flowcharts to understand the logic processing of data. ◼ To visualize how statements in a program are interrelated. ◼ Although time consuming, it’s the best tool for beginners. ◼ Use of symbol and phrases to designate the logic of how a problem solved. ◼ A common method for defining the logical steps of flow within a program by using a series of symbols to identify the basic input, process and output (IPO’s) function within a program. ◼ A diagram representing the logical sequence in which a combination of steps or operation is to be performed. It is a blueprint of the program. Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 15. Flowcharting Types of Flowcharts ◼ Program Flowcharts ◼Depicts the detailed logical flow of process in a program. ◼ System Flowcharts ◼Shows the logic flow of data from one source to another. ◼Divided into functions of departments or personnel. ◼Symbols are used to represent documents used and operations undertaken. ◼Highlights excessive information flow, duplication of information stored in different locations and reasons for delay of transactions. Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 16. Basic Flowcharting Symbols Terminal block Input/Output block Process symbol Decision symbol On-page Connector Off-page Connector Initialization symbol Flow lines Flowcharting Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 17. Basic Flowcharting Symbols ◼ Terminal - used to signify the beginning and end of flowchart Flowcharting OVAL START Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 18. Basic Flowcharting Symbols ◼ Preparation/Initialization - signifies the preparation of data - Used to select initial conditions - Used to represent instructions or group of instructions that will alter or modify a programs course of execution Flowcharting Hexagon SUM=0 PRODUCT=0 Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 19. Basic Flowcharting Symbols ◼ Input/Output -shows input and output. Data are to be read into the computer memory from an input device or data are to be passed from the memory to an output device. Flowcharting Parallelogram Read A Print A Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 20. Basic Flowcharting Symbols ◼ Process/Processing -performs any calculations hat are to be done. Flowcharting Rectangle Sum = A+B Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 21. Basic Flowcharting Symbols ◼ Decision -signifies any decisions that are to be done. Two alternative execution paths are possible. The path to be followed is selected during the execution by testing whether or not the condition specified within the outline is fulfilled. Flowcharting Diamond If x>5 T F Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 22. Basic Flowcharting Symbols ◼ On-page Connector -show the entry or exit point of the flowchart. A non-processing symbol used to connect one part of a flowchart to another without drawing flowlines. Conserves space by keeping related blocks near one another, reduces the number of flowlines in complex program and eliminates cross lines from taking place. Flowcharting A Small Circle Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 23. Basic Flowcharting Symbols ◼ Off-page Connector -designates entry or to exit from one page when a flowchart requires more than one page. Flowcharting Pentagon B Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 24. Basic Flowcharting Symbols ◼ Flowlines -signifies the process that is to be executed next Flowcharting Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 25. Basic Flowcharting ◼ Almost every program involves the steps of input, processing and output. ◼Example: Get number Answer = number *2 Print Answer ◼ Most flowcharts need some way to separate each step. ◼ Drawing different boxes around each statement is the standard convention. ◼ Input operation are represented in a parallelogram. A statement in English is written inside the parallelogram. Flowcharting Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 26. What are Variables? ◼ Memory allocations, the content of which may vary/change. ◼ The capability of memory variables to change its content makes the computers and programming worthwhile. ◼ Because one memory location can be used over and over again with different values, program instructions can be written once and then used for thousands of problems. ◼ Giving names (for identification) may vary from one programming language to another; some may allow hyphens; others allows underscores; some languages allow dollar signs, others don’t. There are languages that limits the length of names to a variable. Flowcharting Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 27. Rules in naming variables... ◼ Must be one word. ◼ May contain letters, numbers, hyphens, underscores. ◼ Must not start with a number. ◼ Must not contain a space. ◼ Must have some meaning. Invalid Variable names  interest rate - should be one word  rate! - contains ! an invalid character  xyxxx - although this is allowed, it doesn’t mean or imply anything that it may hold.  #total - should not start with a special character. Flowcharting Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 28. Types of Variables ◼ Numeric Variables ◼ The type of variable that can hold a number. ◼ In this example: Answer = number * 2 ◼ Some languages allow additional types of data; Pascal and C distinguish between integer or whole number numeric variables and floating point, decimal and fractional numeric variables. ◼ Character, Text or String Variables ◼ Variables that can hold letters of the alphabet and other special character such as punctuation marks. ◼ Example: NAME = “WASHINGTON” ◼ Logical or Boolean Variables ◼ A special type of variable that can only have two values - TRUE or FALSE. Flowcharting Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 29. Arithmetic Operators and Mathematical Statements ◼ Addition (+) ◼ Subtraction (-) ◼ Multiplication (*) ◼ Division (/) ◼ Modulus (%) ◼ A mathematical statement is composed of a left variable, an assignment operator (usually in the form of an equal sign) a series of operands(may be a set of the same variables or a new set of variables, and /or constants) and (arithmetic) operators. ◼ Example: x = x + 1 sum = a + b Flowcharting Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 30. Constants ◼ A constant is a value that never changes during the execution of the program. ◼ Constants can be any type-numeric, alphabetic or special symbols. ◼ Like variable, constants can be named. The computer sets up a specific memory location to hold the value of the constant. ◼ During the execution of the program, the constant is referred to by name. Once the constant is given a value, it cannot be changed during the execution of the program. Flowcharting Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 31. Relational Operator ◼ A relational operator compares two values and determines the relationship between them. Operator Use Returns true if > op1 > op2 op1 is greater than op2 >= op1 >= op2 op1 is greater than or equal to op2 < op1 < op2 op1 is less than op2 <= op1 <= op2 op1 is less than or equal to op2 == op1 == op2 op1 and op2 are equal != / not= op1 != op2 op1 and op2 are not equal op1 not= op2 Flowcharting Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 32. Logical Operators ◼ Use logical operators (also called Boolean operators) to express relationships between search expressions. Operator Use Returns true if and cond1 and cond2 both condition should be true or cond1 or cond2 either one of the condition is true not (negation) not cond ! cond Flowcharting Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 33. ADVANTAGES OF USING FLOWCHARTS 1. Communication: Flowcharts are better way of communicating the logic of a system to all concerned. 2. Effective analysis: With the help of flowchart, problem can be analyzed in more effective way. 3. Proper documentation: Program flowcharts serve as a good program documentation, which is needed for various purposes. 4. Efficient Coding: The flowcharts act as a guide or blueprint during the systems analysis and program development phase. 5. Proper Debugging: The flowchart helps in debugging process. 6. Efficient Program Maintenance: The maintenance of operating program becomes easy with the help of flowchart. It helps the programmer to put efforts more efficiently on that part Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 34. LIMITATIONS OF USING FLOWCHARTS 1. Complex logic: Sometimes, the program logic is quite complicated. In that case, flowchart becomes complex and clumsy. 2. Alterations and Modifications: If alterations are required the flowchart may require re-drawing completely. 3. Reproduction: As the flowchart symbols cannot be typed, reproduction of flowchart becomes a problem. 4. The essentials of what is done can easily be lost in the technical details of how it is done. Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 35. Draw 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 Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 36. Draw a flowchart that will compute and display the sum and product of two numbers. Write its equivalent algorithm. Algorithm: Step 1: Initialize Sum and Product into 0. Step 2: Read in the values of A and B. Step 3: Compute the sum by adding A and B then compute the product by multiplying A and B. Step 4: Print the computed value of Sum and Product. START Read A,B Print Sum, Product END Sum = 0 Product = 0 Sum = A + B Product = A * B Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 37. Construct a flowchart that will convert an inputted number in Fahrenheit to its equivalent measure in Celsius. Formula: C = (5/9)*(F-32) Algorithm: Step 1: Initialize Celsius into 0. Step 2: Read in the value of Fahrenheit. Step 3: Compute the value of Celsius. Step 4: Print the computed value of Celsius. START Read Fah Print Celsius END Celsius=0 Celsius=(5/9)* (Fah-32) Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 38. Draw a flowchart that will input values for A and B. Compare two values inputted and print which of the values is higher including the remark “Higher”. Write its equivalent algorithm. Algorithm: Step 1: Read the values of A and B. Step 2: Test if A is greater than B. Step 3: If A is greater than B, A is higher. However, if A is less than B, B is higher. Step 4: Print the number and the remark “Higher” START Input A,B Print A, “Higher” END A > B Print B, “Higher” T F Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 39. Draw a flowchart that will input grade of student and determine whether the grade is passed or failed. Print the name, grade and remarks of student. Write its equivalent algorithm. Algorithm: Step 1: Initialize name and remarks into blanks. Step 2: Read in values for Grade and Name. Step 3: Test if Grade is greater than or equal to 60. Step 4: If Grade is greater than or equal to 60, remark is “Passed”. However, if Grade is below 60, remark is “Failed”. Step 5: Print the name, grade and remarks. START Read Name, Grade END If Grade >60 Print Name, Grade, Remarks Name=“ “ Remarks = “ “ Remarks = “Failed” Remarks = “Passed” Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 40. SEATWORK ◼ DEI Manufacturing Company plans to give a year- end bonus to each of its employee. Draw a flowchart which will compute the bonus of an employee. Consider the following conditions: If the employee’s monthly salary is less than 2,000 pesos, the bonus is 50% of the salary; for employees with salaries greater than 2,000 pesos, the bonus is 1,500 pesos. Print the name and the corresponding bonus for each employee. Write each equivalent algorithms. Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 41. Pseudocode ◼ uses everyday language to prepare a brief set of instructions in the order in which they will appear in the finished program. ◼ It is an abbreviated version of actual computer code (that's why it is called pseudocode). ◼ Pseudocode looks more like a real program than the flowchart does. It allows the programmer to focus on the steps required to solve a program rather than on how to use the computer language. ◼ An advantage of pseudocode is that it can be used to describe a program to a nontechnical user and can still provide guidelines for the writing of program code. Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794
  • 42. Pseudocode ◼ A textual presentation of a flowchart ◼ Close to a natural language ◼ The control structures impose the logic ◼ May become a part of the program documentation ◼ Could be translated into a program Downloaded by nuevo dennis (atgimil@gmail.com) lOMoARcPSD|32539794