Chap2 - 2.1 Understand Problem Solving Concept

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

DFC1023

PROBLEM SOLVING
AND PROGRAM
DESIGN
CHAPTER 2.0
PROBLEM SOLVING METHODS

1
COURSE LEARNING OUTCOME (CLO):
Upon completion of this course, students should be able to:

1) Explain the basic computer and programming


fundamentals with appropriate examples of languages.

2) Practice different types of algorithm to solve problem


efficiently.

3) Solve problem by applying related theories of the basic


programming technique to a given particular scenario
using programming life cycle.

2
SPECIFIC OUTCOME:
2. 1 Demonstrate the understanding of
Programming Life Cycle
2.2 Understand problem solving concept
2.3 Apply the different types and patterns
algorithm to solve problem.

3
2.1 UNDERSTAND PROBLEM SOLVING
CONCEPT

4
PROBLEM SOLVING CONCEPT
 Identifying the problem--Which problem should I address? If
there are several, how do I choose the most important one?
 Describing the problem--How do I accurately and completely
describe the problem?
 Analyzing the problem--What are the different causes of the
problem, and which causes are most important to solve right
away?
 Planning the solutions--What are the different alternative
solutions for solving the problem?
 Implementing the solutions--How do I make sure the
solutions are implemented correctly and effectively?
 Monitoring/evaluating the solutions--How did the solutions
work? What needs to be changed? 5
Define Input, Process
And Output
DEVELOPING THE INPUT PROCESS OUTPUT
(IPO) CHART
 Extends and organizes the information in the
Problem Analysis Chart.
 It shows in more detail what data items are input,
what are the processing or modules on that data,
and what will be the result or output.

Input Processing Output


All input All processing steps All output
data from from IPO requirements
PAC from PAC 6
Identify Input, Process
And Output
DEVELOPING THE INPUT PROCESS OUTPUT
(IPO) CHART

Problem
 Write a Input Process Output (IPO) to find an area
of a circle where area = pi * radius * radius

Input Processing Output


- radius - Area = 3.14 x radius x radius - Area of a circle
-Display area 7
Example
 A program is required to read three (3) numbers,
add them and print their total. It is usually helpful
to write down the three (3) components in a defining
diagram as shown below:

8
STEPS OF PROGRAM EXECUTION
 Input – Refers to the process of entering data, program and
instructions into the computer system using input devices.
 Process – Computer processes raw data into usable
information to be used by user. Data processing is done by the
CPU (Central Processing Unit).
 Output – Output is raw data that has been processed by the
computer (result). Output will be converted to an
understandable form before being displayed or printed.

9
EXAMPLE: FLOW OF ATM PROGRAM
• Assume that our transaction is money withdrawal.
The instructions are:
a. Get the card number from the user (Input)
b. Get pin number from the user (Input)
c. Process the input data (Process)
d. Get the transaction chosen by the user (Input)
e. Get the account type from the user (Input)
f. Process the transaction as wanted by the user (Process)
g. Withdraw amount of money required by the user(Output
h. Print receipt for the user (Output)
10
INPUT PROCESS OUTPUT

 Input: Example: Card number, ATM pin number, type of


transaction, type of account, amount of money to
withdraw.
 Process: Example: Process to identify card number, valid pin
number, type of transaction, type of account and
deducts the withdrawal from the user’s account.
 Output: Example: Receipt will show balance in user’s account
and money withdrawn.
11
EXECUTING A PROGRAM
 To execute a program, CPU will examine each
program instruction in memory and send out the
required command signals to carry out the
instruction.
 During execution, data can be entered into memory
and manipulated in some specific way (delete and
modify) as required.
 Program instructions are used to copy a program's
data (program input) into memory.
 After the input data were processed, instructions for
displaying or printing will be executed.
 Result displayed by a program is called “program
output”.
12
 Example: Cash withdrawal from ATM machine.
Machine language
Step 2
program for processing
card number and PIN Central Processing Unit.
number.
Step 1
Input data: Data entered during
Card Number,
execution.
PIN Number,
transaction. Program Output
Step 3
Computed results. Output results:
Receipt and money

• First step:
– Data entered by user are stored in memory (input).
• Second step:
– CPU will instruct program to process the card number and
ATM pin number with the data in memory concurrently.
Program will execute the transaction chosen by the user and
store the result in memory.
13
• Third step:
– The outputs are money withdrawal and receipt (output).
ACTIVITY 1: FIRE SIDE CHAT
1. Build a group in 3
2. Recall what you have learn in chapter 1 and
chapter 2 (2.1)
3. Write down 3 things that you have learned in
class (only 3 parts)- 3 minutes
4. Move to your friends in class and share the
answer (1 friend=1 aswer)
5. Move again to other friends and share the answer
until you fullfill 7 parts of TREE GRAPHIC
6. I will call 3 people to share the answer

14
DISCUSS 

1. Show step of mailing a copy of your SPM


transcript using photocopy machine.
2. Show step of making call from your telephone.
3. Show step of saving your document in your
computer.
4. Show steps of buying a tin of soft drink for a
vending machine.
5. Show steps of sending an email to your friend.

15
16

You might also like