0% found this document useful (0 votes)
6 views

Sequential logic

The document discusses problem-solving using sequential logic structures, focusing on pseudocode and flowcharts. Pseudocode combines programming code with human language for easier understanding, while flowcharts visually represent processes and workflows using specific symbols. It also explains the use of various flowchart symbols and provides examples for calculating fines and grading marks.

Uploaded by

aitajprince100
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Sequential logic

The document discusses problem-solving using sequential logic structures, focusing on pseudocode and flowcharts. Pseudocode combines programming code with human language for easier understanding, while flowcharts visually represent processes and workflows using specific symbols. It also explains the use of various flowchart symbols and provides examples for calculating fines and grading marks.

Uploaded by

aitajprince100
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Problem Solving with the Sequential

Logic Structure

• The Sequential Logic Structure


• Algorithm Instructions, Flowchart Symbols,
Pseudocode

0-1
Pseudocode

• Human friendly code that cannot be


understood by the machine

!2
Pseudocode

• Steps in problem solving that is written half in programming code and


half in human language.

• For example, some part uses C language code and some part uses
Malay or English language.

• Advantages:
i. Easily understood.
ii. Easily maintained.
iii. The codes are changeable.

• Disadvantages:
Cannot be executed in the computer.
Flowchart

• A graphical representation of data,


information and workflow using certain
symbols that are connected to flow lines to
describe the instructions done in problem
solving.

• It shows the flow of the process from the start


to the end of the problem solving.
Flowchart Explanation
•Enter data from keyboard
START
•Calculate total
•Display data and total
Input

Process

Output

END
Explanation of basic flowchart symbol:
Simbol / Symbol Penerangan / Explanation
➢Indicate the direction of data flow.
➢Used to connect a block to another block.
Flow Lines

➢Indicates operations / process involved.

Process

➢Receive / read value


➢Display value
Input / Output

➢Execute decision based on condition.


➢Test is performed and the program flow
continues, based on the result.
Decision

Indicates the beginning and end of a


Start / End Flow
Lines
flowchart.

➢Show the continuing flowchart in the


same page.
On-page
connector
Flow Lines
START

Input

Condition True
True Statement

False

False statement

Output

END

Symbol usage !7
Cont…Explanation of basic flowchart symbol:

START

Input
Symbol Explanation
Output

➢Flowchart continues in the


next page. Process

Off Page END


Connector

Next page
B

First page

Symbol Usage
There are few additional symbols of flowchart used in a complicated program:
GOSUB and RETURN. It’s usually used in a big program.

Symbol Explanation

Instruct the executed instruction to move to the next


function

GOSUB

Instruct the executed instruction to return to the next


instruction after the GOSUB instruction, called the
function.
RETURN
START area

area =22 / 7 * radius * radius


Input radius

Output area
GOSUB area

RETURN

END

Symbol Usage
Example Flowchart:
Flowchart to calculate the total of fine for late returning of library books.

START

Input
total_of_day

Fine = total_of_day * 0.20

Output Fine

END

Symbol Usage
Questions

• Flowchart to find the largest of three


numbers
• Flowchart for grading marks. 90% and
above D1, 80-89 for D2, 75-79 for C3,
60-74 for C4, 50-59 for C5, 40-49 for C6,
35-39 for P8 below 35 for F9.

!12

You might also like