0% found this document useful (0 votes)
13 views28 pages

WK3 Lesson2

The document outlines a lesson on program design tools, focusing on structured programming concepts, algorithms, flowcharts, and pseudocode. It includes objectives for trainees, group presentations on programming approaches, and examples of pseudocode and flowcharts for various problems. Additionally, it provides guidelines for creating effective flowcharts and includes individual and group assignments for practical application of the concepts discussed.

Uploaded by

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

WK3 Lesson2

The document outlines a lesson on program design tools, focusing on structured programming concepts, algorithms, flowcharts, and pseudocode. It includes objectives for trainees, group presentations on programming approaches, and examples of pseudocode and flowcharts for various problems. Additionally, it provides guidelines for creating effective flowcharts and includes individual and group assignments for practical application of the concepts discussed.

Uploaded by

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

LESSON2 WK3

PROGRAM DESIGN TOOLS

Presentation by
MANZA JOSHUA KIILU
OBJECTIVES
By the end of the lesson the trainee should
be able to:
A)Describe structured programming design
concepts
B)Describe program design tools
 ALGORITHMS
 FLOWCHARTS
 PSEUDOCODE

MANZA JOSHUA
3 GROUP PRESENTATIONS ON
PROGRAMMING APPROACHES
 GROUP 1
Discuss on TOP-DOWN approach
 GROUP2
Discuss on BOTTOM UP approach
 GROUP3
Discuss on DATA DRIVEN approach
N/B Each to present for 10 minutes
MR MANZA 02/05/2025
4 PROGRAM DEVELOPMENT TOOLS

DEVELOPMENT OF ALGORITHMS
After carefully analyzing the requirements specification, the
programmer usually comes up with the algorithm.
An Algorithm is a limited number of logical steps that a program follows in order to
solve a problem.
A step-by-step (a set of) instructions which when followed will produce a solution to a
given problem.
Algorithms take little or no account of the programming language.
They must be precise/ accurate, unambiguous/clear and should guarantee a solution.

MANZA JOSHUA
02/05/2025
Algorithms can be illustrated
using the following tools:
 Pseudo codes.
 Flowcharts.
 Decision Tables.
 Decision Trees.
PSEUDOCODES
Pseudocode : are structured English-like phrases that indicate the
program steps to be followed to solve a given problem.
Guidelines for designing a good pseudocode.
 The statements must be short, clear and readable.
 The statements must not have more than one meaning
 The pseudocode lines should be clearly outlined and indented.
 A pseudocode must have a Begin and an end.
 The input, output and processing statements should be clearly
stated using keywords such as PRINT, READ, INPUT, etc.

MANZA JSOHUA
Example 1:
Write a pseudocode that can be used to prompt the user to enter
two numbers, calculate the sum and average of the two numbers
and then display the output on the screen.
START
PRINT “Enter two numbers”
INPUT X, Y
Sum = X + Y
Average = Sum/2
PRINT Sum
PRINT Average
STOP
MANZA JOSHUA
Example 2:
Write a structured algorithm that would prompt the user to enter the
Length and Width of a rectangle, calculate the Area, then display the
result.

Solution

Step 1: Draw the rectangle of Length (L) and Width (W).


Step 2: Write down the Pseudocode.
START
PRINT “Enter Length and Width”
READ L, W
Area = L * W
PRINT Area
STOP
zn'r karich
Write a pseudocode that can be used to calculate
the Diameter, Circumference and Area of a circle
and then display the output on the screen.(Groups
of twos)

5 minutes
Class assignment

 Write a pseudocode to
calculate volume of a sphere
FLOWCHARTS
A Flowchart is a chart that demonstrates the logical sequence of events
that must be performed to solve a problem.
Types of Flowcharts.
System flowchart. This is a graphical model that illustrates
(in summary) the sequence of events in a system, showing
the department or function responsible for each event.
Program flowchart. This is a diagram that describes, in
sequence, all the operations required to process data in a
computer program
PROGRAM FLOWCHARTS.
A Flowchart is constructed using a set of special
shapes (or symbols) that have specific meaning.
Symbols are used to represent operations, or data flow
on a flowchart.

Each symbol contains information (short text) that


describes what must be done at that point.

The symbols are joined by arrows to obtain a


complete Flowchart. The arrows show the order in
which the instruction must be executed.
MANZA JOSHUA
SYMBOLS USED IN PROGRAM
FLOWCHARTS
Terminal symbol.

Ellipse (Oval in shape)

It is used to indicate the point at which a flowchart, a process or an algorithm begins


& ends.
All Flowcharts must have a START & STOP symbol. The START/BEGIN symbol is the
first symbol of a flowchart, & identifies the point at which the analysis of the
flowchart should begin. The STOP/END symbol is the last symbol of a flowchart, &
indicates the end of the flowchart.

The words Begin & End (or Start & Stop) should be inserted in the Terminal symbol
Input or Output symbol.

(Parallelogram)

It is used to identify/specify an input operation or output operation.

For example;

INPUT OPERATION OUTPUT OPERATION


Note. The words mostly associated with I/O operations are READ & PRINT. READ
describes the entry of computer data, while PRINT relates to the printed output of
information.
Process symbol

(Rectangle)
- Process symbol is used to indicate that a processing or data transformation is taking place.
The information placed within the process symbol may be an algebraic formula or a sentence
to describe processing.

SUM = A + B Commission is computed at 20% of Total Sales


Processing defined as a Formula Processing defined as a Sentence
Decision symbol

4. Decision symbol.

NO (Rhombus)

YES

- It is used to indicate/ specify a condition or to show the decision to be made.


There are 2 main components of a Decision symbol:
(i). A question asked within the Decision symbol, that indicates the comparison / logical
operation.
(ii). The results of the comparison (which are given in terms of YES or NO).
The arrows labeled YES or NO lead to the required action corresponding to the answer to the
question.
FLOW LINES

5. Flow lines.

Flow lines with arrowheads are used to indicate the direction of processing of the program
logic, i.e., they show the order in which the instructions are to be executed.
The normal flow of a flowchart is from Top to Bottom, and Left to Right.
Note. Flow lines should never cross each other.
CONNECTOR

6. Connector symbol.

Sometimes, a flowchart becomes too long to fit in a single page, such that the flow lines start
crisscrossing at many places causing confusion & also making the flowchart difficult to
understand.
The Connector symbol is used as a connecting point for arrows coming from different
directions.
General guidelines for drawing a program flowchart.

 A flowchart should have only one entry/starting point and one exit point (i.e., ensure that the
flowchart has a logical start and finish).
 The flowchart should be clear, neat and easy to follow.
 Use the correct symbol at each stage in the flowchart.
 The flowchart should not be open to more than one interpretation.
 Avoid overlapping the lines used to show the flow of logic as this can create confusion in the
flowchart.
 Make comparison instructions simple, i.e., capable of YES/NO answers.
 The logical flow should be clearly shown using arrows.
 Note. A flowchart should flow from the Top to Bottom of a page, and from the Left to the
Right.
 Where necessary, use Connectors to reduce the number of flow lines.
 Connectors are helpful when a flowchart is several pages long, and where several loops are
needed in the logic of the flowchart.
 Check to ensure that the flowchart is logically correct & complete.
Discuss advantages and
disadvantages of flowcharts
(In Groups of threes)

3 minutes
Example 1:

Draw a flowchart for a program that can be used to prompt the user to enter two numbers, find
the sum and average of the two numbers and then display the output on the screen.
Start

X, Y

Sum = X + Y
Average = Sum/2

PRINT Sum, Average

Stop
Example 2:

Draw a flowchart for a program that would prompt the user to enter the Length and Width of a
rectangle, calculate the Area and Perimeter, then display the result.
Start

L, W

Area = L x W
Perimeter = 2 (L x W)

PRINT Area, Perimeter

Stop
Class assignment

Write a flowchart to display area and


perimeter of a rectangle
Lesson review (5 minutes)
INDIVIDUAL ASSIGNMENTS

QUESTION1

Draw a flowchart for a program that can be used to calculate the Diameter,
Circumference and Area of a circle and then display the output on the screen .
QUESTION2
Design a flowchart for a program that can be used to classify people according to
age. If a person is more than 20 years; output “Adult” else output “Young
person”.
QUESTION3
Draw a flowchart for a program that would be used to classify animals according
to sex. If a letter M is input, the program should display ‘Male’ otherwise it
should display “Female”.
GROUP WORK ASSIGNMENT

Discuss in groups of three:


1. Write a program using a flowchart to convert
temperature from 0C to 0F. Fahrenheit =32 + (9o x
C/5).
2. Discuss and write notes on program control structures
3. Describe decision table and decision tree
THANK YOU

You might also like