Date post: | 25-Nov-2023 |
Category: |
Documents |
Upload: | independent |
View: | 0 times |
Download: | 0 times |
Lecturer : Koo Lee Chun (Ext. 305)
ICT 1101
PROGRAM LOGIC FORMULATION Topic 2 : Problem Solving Organization
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 :
Prepared by Koo
• line the beginning of problem analysis Problem Analysis
Chart (PAC)
• shows the overall solution layout or structure
Structure Chart or Interactivity Chart
• shows the input, processes and output of a solution IPO Chart
• show the sequence of instructions comprising the solution Algorithms
• graphic representations of the algorithms. Flowcharts
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..)
Prepared by Koo
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
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
Prepared by Koo
Note: END – end the entire program EXIT – exit point of the module
Flowchart
• Based on algorithms, the programmer produce flowchart, a
graphical representation of the algorithms.
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