Search for notes by fellow students, in your own course and all over the country.

Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.

My Basket

You have nothing in your shopping cart yet.

Title: Introduction for Algorithm and Flowchart
Description: Algorithm is a finite set of instructions that specify the sequence of operations to be carried out in order to solve a specific problem or class of problems. A flowchart is a graphical representation of decisions and their results mapped out in individual shapes.

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


INTRODUCTION TO ALGORITHM &
FLOWCHART
DICT22- COMPUTER PROGRAMMING 1

ALGORITHM
Algorithm is a finite set of instructions
that specify the sequence of operations to
be carried out in order to solve a specific
problem or class of problems
...


Pseudocode
is an informal high-level description of the
operating principle of a computer program
or other algorithm
...

Pseudocode is a "text-based" detail
(algorithmic) design tool
...


Example:
Design a flowchart that will accept and display a number
...

START
READ N
PRINT N
END

ALGORITHM:
1
...

2
...


Example:
Draw a flowchart that will compute and display the sum
and product of two numbers
...

START
SUM=0
PRODUCT=0

READ A, B
SUM=A+B
PRODUCT=A*B

ALGORITHM:
1
...

2
...

3
...

4
...


PRINT SUM,
PRODUCT

END

Basic Control Structures
SELECTION (If-then-else)- a choice is provided
between two alternatives
...
Print the name, grade and
remarks of student
...


Example:
START

ALGORITHM:
STEP 1: INITIALIZE Name AND Remarks INTO BLANKS
STEP2: READ IN VALUES FOR Name AND Grade
...

STEP 4: IF Grade IS GREATER THAN OR EQUAL TO 60,
Remark IS “Passed”
...

STEP 5: PRINT THE Name, Grade AND Remarks

Name=“ “
Remarks=“ “

READ
Name,
Grade

Grade≥
60

F
Remarks=“Failed”

T

Remarks=“Passed”

PRINT Name,
Grade,
Remarks

END

Basic Control Structures
Repetition (Looping)
Do-while-this structure provides for the repetitive execution of
an operation or routine while the condition is true
...


C
T

F

Example:
START

C=0

C<10

T
C=C+1

PRINT C

F

END

ALGORITHM
STEP 1: INITIALIZE THE VALUE
OF C TO 0
STEP 2: TEST IF C IS LESS THAN
10
STEP 3: IF C IS LESS THAN 10,
ADD 1 TO THE VALUE OF C,
PRINT THE VALUE THEN GO
BACK TO STEP 2
...


Exercise:
1
...
Formula: C=(5/9) x (F-32)
2
...

Compare two values inputted and print which of the
values is higher including the remark “Higher”
...

3
...
Initialize C = 0 and F = 0
2
...
Compute Celsius(C) using
C=(5/9)x(F-32)
4
...
Initialize A=0, B=0 and
Remarks
2
...
Compare values of A and
B
...
If A is higher than B then
display A with a "Higher"
remark, else display B
with a "Higher" remarks
...
Initialize sum = 0
2
...
Add them and store the
result in sum
4
Title: Introduction for Algorithm and Flowchart
Description: Algorithm is a finite set of instructions that specify the sequence of operations to be carried out in order to solve a specific problem or class of problems. A flowchart is a graphical representation of decisions and their results mapped out in individual shapes.