Vous êtes sur la page 1sur 22

ICT 1101

PROGRAM LOGIC FORMULATION


Topic 2 : Problem Solving Organization
Lecturer : Koo Lee Chun (Ext. 305)
Learning Outcome
Successful students should be able to:
• List and describe the basic tools used to aid in the development of
a solution to a problem :
• Problem Analysis Chart (PAC)
• Structure Chart or Interactivity Chart
• IPO Chart
• Algorithms
• Flowcharts
• Describe the categories of documentations

Prepared by Koo Lee Chun


How computer store data
• Data are stored internally in memory location according to variable
names
• These memory locations are temporary, as internal memory
is volatile.
• When a program is completed or the computer is turned off, the
content in the memory is destroyed.
• Data that needs to be retained or intended for future use should
be stored externally on a storage medium such as hard disk or
floppy disk in storage area called files

Prepared by Koo
Communication with Computer
• Basically, for a computer to “understand” a message, it
requires instructions with specific rules.
• If the instructions that are provided is incorrect the computer may
give an error message, the wrong answer or may not respond at all.
• The main challenge in problem solving is to provide the most
efficient solution.
• When efficiency is important, only then should each solution be
examined and kept or discarded
• Two programmers may develop equally good solutions to a
problem, but the solutions may look entirely different.

Prepared by Koo
Organizing the problem
• Some organization tools can be used to help us learn to solve
problem in computer. These included :

Problem Analysis • line the beginning of problem analysis


Chart (PAC)
Structure Chart or • shows the overall solution layout or
Interactivity Chart structure

• shows the input, processes and output of a


IPO Chart solution

• show the sequence of instructions


Algorithms comprising the solution

Flowcharts • graphic representations of the algorithms.

Prepared by Koo
Problem Analysis Chart (PAC)
• Divide problem into four major parts.

Prepared by Koo
PAC Example
Problem : Calculate the gross pay of an employee who worked based
on hourly rate. Formula to be used is GrossPay = Hours x Pay rate

The asterisk (**) in the Solution Alternatives column indicates that this
alternative will be chosen.

PAC helps to identify essential data and information, and disregards


the nonessential
Prepared by Koo
Structure Chart or Interactive Chart
• Divide the processing into subtasks called modules and connect
them together to show interaction of processing between the
modules
• Each modules contain instructions to accomplish a specific task
such as entering data, printing the result, calculating result
• There will be one module (Control or Main module) that control
the flow to most of the modules
• The Control Module should be placed at the top-most of the chart,
while the subtasks are then located below it

Prepared by Koo
Structure Chart (Cont..)
Indicate that the modules are part
of a set of modules that are
processed many times

Indicate only one of the module will


be executed based on the decision

Prepared by Koo
Structure chart Example

Prepared by Koo
IPO Chart
• IPO (Input-process-output) chart extends and organizes the
information in the problem analysis chart

Prepared by Koo
Writing Algorithms
• After using the structure chart and the IPO chart, the next step is
develop sets of instruction for computer, called algorithm.
• The programmers writes a separate sets of instructions for each
module in the structure chart
• The algorithms pull the structure chart and IPO chart together to
give a logical step-by-step solution.

Prepared by Koo
Algorithm Example

Note:
END – end the entire program
EXIT – exit point of the module

Prepared by Koo
Flowchart
• Based on algorithms, the programmer produce flowchart, a
graphical representation of the algorithms.

Prepared by Koo
Flowchart (cont..)

Prepared by Koo
Example Flowchart

Prepared by Koo
Example Flowchart (cont..)

Prepared by Koo
Documentation
• 2 basic types of documentation:
• Internal documentation :
• consists of remarks written with the instructions to
explain what is being done in the program.
• For programmer
• External :
• made up of the manuals or help menus written about
the solution.
• For user of the system

Prepared by Koo
Review Learning Outcome
Successful students should be able to:
• List and describe the basic tools used to aid in the development of
a solution to a problem :
• Problem Analysis Chart (PAC)
• Structure Chart or Interactivity Chart
• IPO Chart
• Algorithms
• Flowcharts
• Describe the categories of documentations

Prepared by Koo Lee Chun


Solve a problem

All marble balls have the same weight (3g) except one
(3.5g).

Can you help to identify this marble ball from others ?

Prepared by Koo

Vous aimerez peut-être aussi