0% found this document useful (0 votes)
77 views11 pages

Sequence Algorithm Examples

The document discusses elements of algorithms including variables, symbols used, and types of algorithms like sequence and repetition. It provides examples of writing sequence algorithms, noting that algorithms are not specific to any programming language. Key steps in writing a sequence algorithm are defining variables, initializing values, inputting values, processing, and displaying output. Examples are given of writing algorithms to find the sum of two numbers and calculate percentage.

Uploaded by

Earl John Plaza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views11 pages

Sequence Algorithm Examples

The document discusses elements of algorithms including variables, symbols used, and types of algorithms like sequence and repetition. It provides examples of writing sequence algorithms, noting that algorithms are not specific to any programming language. Key steps in writing a sequence algorithm are defining variables, initializing values, inputting values, processing, and displaying output. Examples are given of writing algorithms to find the sum of two numbers and calculate percentage.

Uploaded by

Earl John Plaza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

ALGORITHM

ELEMENT OF ALGORITHM

VARIABLES
Math:
A letter that can represent any
number

Programming:
A letter/word that serve as a
temporary storage that can
represent any value
ELEMENT OF ALGORITHM

VARIABLES
RULES IN CREATING VARIABLES
• Do not use special characters ( *,/,\,
#)
• Don’t start in numbers (Ex. 1A, 2B, 3C)
• Start with letters
ELEMENT OF ALGORITHM

SYMBOLS
’+’ for Addition
’-’ for Subtraction
’*’ for Multiplication
’/’ for Division
’=’ Assignment operator
, Separator
; End of statement
TYPES OF ALGORITHM

SEQUENCE REPETITION

1 2 3

SELECTION
PROCESS
• Input
• Process
• Output

SEQUENCE REPETITION

1 2 3

SELECTION
WE CAN CREATE MANY
POSSIBLE ANSWER
Solution B

Solution A Solution C
HOW TO WRITE
SEQUENCE
ALGORITHM
NEED TO REMEMBER
 Writing algorithm does not have any well defined-
standards

 Algorithms are never created to support a specific


programming language

 As well know, basic code features such as loops (do,


for, whole all programming language share), flow
control (if-else), and so on.

 We usually create algorithms step by step; however,


this isn’t always the case.

 After the problem domain has bee well-defined,


algorithm writing is a procedure that is carried
out.
PROBLEM #1 SEQUENCE ALGORITHM

1. Write an algorithm to read two


numbers and find their sum.

REMINDER: For to create an algorithm you have to


identity first the variables, input and output.

Step 1. Define the variables needed


Step 2. Initialize the value for each variables
Step 3. Input value of variables
Step 4. Process the sum of two numbers
Step 5. Display output
PROBLEM #2
2. Create a algorithm that will display the sum of 2
numbers inputted by the user.

PROBLEM #3
3. There are 45 carpenters in a crew. On a certain
day, 9 were present. What percent showed up for work?

Using this Formula:


R= P/B

You might also like