ICT1101 PLF Lesson 3
Lesson Three: Problem Solving Organization
Objectives:
1. List and design the seven tools used in the development of program. These
tools include the problem analysis chart, the structure chart or interactivity
chart, the IPO chart, data dictionary, algorithms and flowcharts.
2. Describe the importance of internal and external documentation.
PROBLEM SOLVING ORGANIZATION
Analyzing Problems
To organize a solution, the programmer, need to understand and analyze the
requirements of the problem.
Few tools are used in the aid of program development.
There are seven basic development tools used in the program development aid in
construction of program logic for a problem:
1. Problem Analysis Chart (PAC)
2. Structured Chart
3. Input Process Output Chart (IPO)
4. Coupling Diagram
5. Data Dictionary
6. Algorithm
7. Flowchart/BOX diagram
Problem Analysis Chart (PAC)
1. PAC (Problem Analysis Chart) is a way to shows a beginning analysis of
problem.
A problem is divided into four sections.
1. The given data
2. The required results
3. The processing that is required in the problem
4. A list of solution alternatives.
Page 1 of 10
ICT1101 PLF Lesson 3
Given Data Required Results
Section 1: Section 2:
Data given in the problem or The output after processing
provided by user (input variables)
Required Process Alternative Solutions
Section 3: Section 4:
List of processing required List of ideas for the solution of the
problem
For example:
Calculate the gross pay of an employee. Formula to be used is
GROSSPAY = HOURS * PAYRATE
The solution alternatives are as follows:
1. Define the hours worked and pay rate as constants.
2. Define the hours worked and the pay rate as input values.
The second solution will be used, different employees may have
different pay rate.
Given Data Required Results
Hours, Payrate Grosspay
Required Process Alternative Solutions
Grosspay = Hours * Payrate 1. Define the Hours and Payrate as
constants.
2. Define the Hours and the
Payrate as input values.
Page 2 of 10
ICT1101 PLF Lesson 3
Structure chart
Structure chart divides the problem into subtasks called modules and shows the
way the modules interact with each other.
Each module should contain the tasks to accomplish one function such as
entering data, printing results or calculating results.
This breakdown (also called top-down design) enables you to view a complex
program in simpler and smaller parts and understand the task of each module
more easily.
It controls the processing of
all the data. And controls the
Control flow of the other modules.
Module
0000
Input Process Print
Module Module Module
1000 2000 3000
Input Processing Output (IPO) chart
IPO chart organizes the information in the Problem analysis chart (PAC).
Shows more details of what data item are input, processing of the data and the
end result (output).
The output is the first to be completed in IPO chart, then is input and at last is
processing. (You need to know where you want to go first, then you decide what
to pack).
Page 3 of 10
ICT1101 PLF Lesson 3
IPO Chart
INPUT PROCESS Module reference No OUTPUT
All input data All processing in Module reference All output
(variables) steps number from structure requirements
PAC section 1 (PAC section 3 & chart (PAC section 2)
section 4)
For example:
INPUT PROCESS Module reference No OUTPUT
Hours 0.Begin 0000 Grosspay
Payrate 1.Enter Hours 1000
2. Enter Payrate 1000
3. Calculate Grosspay 2000
4. Print Grosspay 3000
5. End 0000
Coupling Diagram
Coupling Diagram
It shows which variables are passed from one module to another.
Control Pay Salary
Hours
Hours Rate
Rate Salary
Salary
Hours Rate Rate Salary
Hours
Read Calculate Print
Remarks:
1. Double-headed arrows – means that the parameter is call-by reference and changes can be seen by
both modules.
Page 4 of 10
ICT1101 PLF Lesson 3
2. Single-headed arrows – means that the parameter is call-by-value and changes can only be seen
by the called module.
Page 5 of 10
ICT1101 PLF Lesson 3
Data Dictionary
o It shows which modules use each variable and the scope of each
variable (whether the variable is local or global).
Data Dictionary
Item Variable Data type Module Scope Pseudonyms/Module Error Checks
name
Hours Hours Numerical – Read, Global None Hours < 0
worked Real Calculate
Hourly Rate Numerical – Read, Global None None
rate real calculate
Net pay Salary Numerical – Calculate, Global None None
real print
Name of module(s) Either is global Any similar Any
this variable variable or local name for this validation
appeared variable module checking on
(global/local)
the data in
this variable
Algorithms
After using the structure chart and the IPO chart the next step in organizing a
solution is for the programmer to develop sets of instructions for the computer,
called algorithms
Problem: Multiply two numbers and print the result
{This program find the product of two numbers}
Begin
Input Number1, Number2 {Read numbers from the keyboard}
Result = Number1 * Number2 {Multiply Number1 by Number2 and store
answer in Result}
Display Result {Output Result form memory}
End
Page 6 of 10
ICT1101 PLF Lesson 3
Desk check table
Once algorithm or pseudocode has been developed, it should be subjected to a
desk-check.
Desk checking is the process of testing the algorithm or pseudocode to ensure the
logic and output is correct.
Test data: This table shows the data to be used to test and the expected results in
each case.
Test data Expected
result
Number1 Number2 Result
10 5 50
25 -5 -125
-52 -1 52
Desk check table
Test Number1 Number2 Result
1 10 5 50
2 25 -5 -125
3 -52 -1 52
Flowchart
Graphic representation of the algorithms that shows the flow of the processing
from the beginning to the end of a solution.
Flowchart can be used to show the errors in logic that is not readily visible in the
other charts and a set of data can be tested easily using a flowchart.
Page 7 of 10
ICT1101 PLF Lesson 3
Symbols Explanation
Start Flattened ellipses
End/Stop/Exit Begin and the end of module.
Input / Output Parellelogram
Input and output of data from memory.
Processing Rectangle
Data processing, such as calculations,
opening, closing files and so forth.
Flow lines Arrows
Shows the direction of data flows.
Decision Diamond
Indicates a decision.
It has one entrance and only two exits from
the block (True and False).
(Used in decision and loop logic structures)
On-Page Connector Circle
Used to connect different flowchart sections.
Off-page connector
Page 8 of 10
ICT1101 PLF Lesson 3
Automatic Counter Polygon
Loop Indicates a loop with counter (a variable).
Counter A – beginning value.
A B B – the ending value.
S S – the incrementor value.
Process module Indicate the process of a module
Rules for drawing flowcharts:
1. You should write the instructions inside the blocks.
2. If there is something you need to remember, you can write a note beside a
block. Test values of variables also can be placed beside flowchart blocks.
This makes the flowchart an annotated flowchart.
3. A flowchart always starts at the top of the page and flows to the bottom. On
and off-page connectors are used to connect parts of the flowchart.
4. Use a flowchart template to draw the symbols and a straight edge to draw the
flowlines, so that the size of the symbols will be the same and neater and
easier to read.
5. Make the blocks big enough to write instructions so the can be easily read.
6. Put the module number and name from the interactivity chart in the upper
right-hand corner of the page for quick reference to the correct module.
7. Have plenty of paper on hand since the final copy of the flowchart normally
will not be the first draft.
8. Use a pencil with large eraser.
Other Problem-solving Tools
a) Nassi-Schneiderman Charts (BOX diagram)
Sometimes called structured flowcharts or N-S charts.
These charts consist of a stack of rectangles one on top of the other and put
together without flowlines.
Page 9 of 10
ICT1101 PLF Lesson 3
Refer to text book, page 486, The Four Structures Using Nassi-Schneiderman
Charts.
Internal and external documentation
Why does every program need a “documentation”?
Every program needs documentation for the user and the other programmer
understand how to use the program or what is happening inside each program.
Allow the end user to find answer to questions while using the program.
So that the end user will have good instructions in order to learn to use the
program in the least amount of time.
Internal documentation consists of remarks written with the instruction to
explain what is being done in the program.
The documentation that been written for the purpose of the people who involve
in maintaining or writing the program only.
Internally means for the use of programmers for enhancement in the future or for
program maintenance.
Purpose: (1) Reference; for the new programmer to learn about the program in
the least amount of time.
External documentation is made up the manuals written about the solution.
It is for the user of the program.
It acts like a user manual to each software you purchase; provide guidelines for
you if some troubleshooting need to be done.
Purposes: (1) for the user to learn to use the program in the least amount of time.
(2) to allow the user to find answers to questions arising while using the program.
Page 10 of 10