0% found this document useful (0 votes)
14 views37 pages

FlowCharting1.pptx

The document provides an overview of flow charts, programming languages, and the program development cycle. It explains the importance of flow charts in visualizing processes, outlines various programming languages from machine to high-level languages, and details the steps involved in program planning and development. Additionally, it includes examples of pseudocode and flowcharts to illustrate algorithms and problem-solving techniques.

Uploaded by

zyra frontuna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views37 pages

FlowCharting1.pptx

The document provides an overview of flow charts, programming languages, and the program development cycle. It explains the importance of flow charts in visualizing processes, outlines various programming languages from machine to high-level languages, and details the steps involved in program planning and development. Additionally, it includes examples of pseudocode and flowcharts to illustrate algorithms and problem-solving techniques.

Uploaded by

zyra frontuna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Flow Charts

Slide 1 of 3
• Flow Charts Defined
– A flow chart is a pictorial representation showing all of the
steps of a process.
Flow Charts
Slide 2 of 3
• Creating a Flow Chart
– First, familiarize the participants with the flow chart symbols.
– Draw the process flow chart and fill it out in detail about
each element.
– Analyze the flow chart. Determine which steps add value
and which don’t in the process of simplifying the work.
Flow Charts
Slide 3 of 3

• Examples of When to Use a Flow Chart


– Two separate stages of a process flow chart should
be considered:
• The making of the product
• The finished product
Problem Solving
Outline and Objective

Program Development Cycle


Programming Tools
Programming Languages:
• Machine Language
• Assembly Language
• High level Language
Machine Language

• The fundamental language of the computer’s


processor, also called Low Level Language.
• All programs are converted into machine language
before they can be executed.
• Consists of combination of 0’s and 1’s that represent
high and low electrical voltage.
Assembly Language
• A low level language that is similar to machine
language.

• Uses symbolic operation code to represent the


machine operation code.
High Level Language
• Computer (programming) languages that are
easier to learn.
• Uses English like statements.
• Examples are C ++, Visual Basic, Pascal,
Fortran and …....
Program Development Cycle
• Software refers to a collection of instructions for the
computer
• The computer only knows what to do what the
programmer tells it to do
• Therefore, the programmer has to know how to solve
problems
Performing a Task on the Computer:

Input Processing Output


Program Planning
• A recipe is a good example of a plan
• Ingredients and amounts are determined by what you
want to bake
• Ingredients are input
• The way you combine them is the processing
• What is baked is the output
Program Planning Tips

• Always have a plan before trying to write a program


• The more complicated the problem, the more complex the plan
must be
– Start making a seared foie gras with lavendar honey without
knowing the recipe?
– Lots of programmers try the same thing with their programs
• Planning and testing before coding saves time coding
Program Development Cycle:
1. Analyze: Define the problem
2. Design: Plan the solution to the problem (algorithm)
3. Choose the Interface: Select the objects (text boxes,
buttons, etc.)
Program Development Cycle:
4. Code: Translate the algorithm into a programming
language (here, VB).
5. Test and Debug: Locate and remove any errors in
the program.
6. Complete the Documentation: Organize all the
materials that describe the program.
Programming Languages

• A programming language is a
set of rules that provides a
way of telling a computer
what operations to perform.
Programming Tools:
• Flowchart
• Pseudocode
• Hierarchy Chart (Structure chart)
Algorithms

• A step by step series of instructions for solving a


problem (a recipe is an example of an algorithm)
• Algorithms are key to solving many problems
efficiently
Problem Solving Example
• How many stamps do you use when mailing a letter?
• One rule of thumb is to use one stamp for every five
sheets of paper or fraction thereof.
Statement Structure
• Sequence – follow instructions from one line to the next
without skipping over any lines
• Decision – if the answer to a question is “Yes”, then one
group of instructions is executed. If the answer is “No”, then
another is executed
• Looping – a series of instructions are executed over and over
Decisions (Switching logic)

Symbol Meaning
== Equals
<> Not equal
< Less than
<= Less than or equal to
> Greater than
>= Greater than or equal to
What is a Pseudocode?

• A program design technique that uses English


words.
• Has no formal syntactical rules.
• The idea is to represent the algorithm in a form that
is in between pure English and actual running code
Examples of Pseudocode:

• Fahrenheit to Celsius :
1. get a value for ftemp
2. set the value of ctemp to (5 / 9) * (ftemp - 32)
3. return the value of ctemp
• Min:
1. get a value for X, Y
2. if X <= Y then
1. return the value of X
3. else
1. return the value of Y
What is a flowchart ?
• Logic diagram to describe each step that the program
must perform to arrive at the solution.

• A popular logic tool used for showing an algorithm in


graphics form.
Continue flowchart
• Programmer prepares flowchart before coding.
• Most common flowchart symbols are:

Flow line Terminal Input/Ouput Decision Processing


Purpose of Flowcharting:

• An aid in developing the logic of a program.


• Verification that all possible conditions have been
considered in a program.
• Provides means of communication with others about
the program.
• A guide in coding the program.
• Documentation for the program.
Flowchart Example
Algorithm:

1. Request the number of sheets of paper; call it Sheets


(input)
2. Divide Sheets by 5 (processing)
3. Round the quotient up to the next highest whole
number; call it Stamps (processing)
4. Reply with the number of Stamps (output)
Decision Flow Chart
Example of Flowchart: Ordering a Burgervdz ews
Pseudocode Flowchart
Algorithm 1 (Standard Process):
1. Approach Counter
2. Order Burger
3. If You Want Fries Then
1. Order Fries
4. Else, Go To Next Step
5. If You Want Drink Then
1. Order Drink
6. Else, Go To Next Step
7. Pay cashier

Algorithm 2 (Improved Process):


1. Approach counter
2. Order Combo Meal
3. Pay cashier
Example of Flowchart and Pseudocode:
Computing Interest on a Loan
Flowchart
Start
Pseudocode
Read NAME
1. Read NAME, BALANCE, RATE BALANCE, RATE
2. Compute INTEREST As
BALANCE x RATE
3. Write (Display) NAME and INTEREST INTEREST = BALANCE x RATE

Write NAME,
INTEREST

Stop
Example of Flowchart and Pseudocode:
Computing The Sum, Average, and Product of Three
Numbers Flowchart
Start
Pseudocode
Read X, Y, Z
1. Read X, Y, Z
2. Compute Sum (S) As X + Y + Z
S=X+Y+Z
3. Compute Average (A) As S / 3 A=S/3
4. Compute Product (P) As X x Y x Z P=XxYxZ
5. Write (Display) the Sum, Average,
and Product
Write S, A, P

Stop
Example of Flowchart and Pseudocode:
Determine Large/Small
Flowchart
Start
Pseudocode
Read A, B
1. Read A, B
2. If A is less than B
1. BIG = B No Yes
BIG = A BIG = B
2. SMALL = A A < B?
SMALL = B SMALL = A
3. Else
1. BIG = A
2. SMALL = B
Write BIG, SMALL
4. Write (Display) BIG, SMALL

Stop
Loops
• Most programs involve repeating a series of instructions
over and over until some event occurs
• For example, if we wish to read ten numbers and compute
the average, we need a loop to count the number of
numbers we have read
• Count loops are loops where the program must count the
number of times operations are completed
Looping Flow Chart
Example of Flowchart:
A Loop that Counts from 1 to 10

Enter loop

K=1

K=K+1

No
K > 10?

Yes
Exit from loop
Class Average Algorithm

• Problem: calculate and report the grade-point average for a


class
• Discussion: the average grade equals the sum of all grades
divided by the number of students
• Output: Average grade
• Input: Student grades
• Processing: Find the sum of the grades; count the number of
students; calculate average
Flowchart:
Determine the Average Grade
Ex: Three grades: 50, 75, 100
Start
counter = 0; sum = 0
Get grade 50
counter = 1; sum = 50
Get grade 75
counter = 2; sum = 125
Get grade 100
counter = 3; sum = 225
No more data
Average = 225 / 3 = 75
Display 75
End

You might also like