You are on page 1of 13

Start or end of the program

Computational steps or processing


function of a program

Input or output operation

Decision making and branching

Connector or joining of two parts of


program
• Design an algorithm and flowchart to find the
sum 2 numbers (A, B).
– Variables:
• A: First Number
• B: Second Number
• C: Sum (A+B)
– Algorithm:
• Step 1 – Start
• Step 2 – Input A
• Step 3 – Input B
• Step 4 – Calculate C = A + B
• Step 5 – Output C
• Step 6 – Stop
• Design an algorithm and flowchart to find the
sum, average and product of 3 numbers (X,Y,Z)
1- Simple sequential Flowchart

- Read X, Y, Z - Compute Product (P) as


- Compute Sum (S) as X + X xYxZ
Y +Z - Write (Display) the Sum,
- Compute Average (A) as Average and Product
S/3
Design Algorithm and Flowchart
• Find the difference and the division of two numbers
and display the result
• Write an algorithm that reads two values,
determines the largest value and prints the
largest value with an identifying message.
ALGORITHM

Step 1: Input VALUE1, VALUE2


Step 2: if (VALUE1 > VALUE2) then
MAX  VALUE1
else
MAX  VALUE2
endif
Step 3: Print “The largest value is”, MAX
Flowchart
• START

• Input
• VALUE1,VALUE2

• Y • is • N
• VALUE1>VALUE2


MAX  VALUE1 •
MAX  VALUE2
• Print
• “The largest value is”, MAX

• STOP
C:Structured Programming Language
• It refers to programming strategy that encompasses a number
of methodologies to produce good quality design code, which
can be easily understood. 3 main principle of SPL is :
– Program design using top-down or bottom-up approach.
– Decomposition of program into components, ie. Modular
programming.
– Structuring of Control flow.
• It is also called middle level language because it support both
system programming and application programming.

You might also like