Topic 4 - Sequential Logic Structure
Topic 4 - Sequential Logic Structure
PROGRAM LOGIC
FORMULATION
Topic 4: Sequential Logic Structure
[email protected]
2019
Learning Outcomes
■ Sequential Structure
– Executes instructions one after another.
■ Decision Structure
– Instructions can branch to execute one of two possible sets of instructions.
■ Loop Structure
– Executes a set of instructions many times.
T F
Is something missing?
Sub = Number1-Number2
Mul = Number1*Number2
Div = Number1/Number2
Example – Spot the Problem
Mul = Number1*Number2
Div = Number1/Number2
Practice
■ Mary
is looking for a bank that will give her the most returns on her savings for over
five years. She has RM2000 to put into a savings account. The standard operation to
calculate principal plus interest at the end of a period of time is:
,where P is the principal (amount of money to invest), I is the interest rate (in
percentage), N is the number of years, and M is the compound interval (number of times
per year the interest is calculated and added to the principal).
Analyze: Use Organization Tools
READ
1000
Interactivity/Structure
INTEREST
CONTROL
0000
READ CALC
1000 2000
Interactivity/Structure
INTEREST
CONTROL
0000