Algorithms and Flowchart
Algorithms and Flowchart
Algorithms and
Flowchart
MAR JONES C. BASWEL
BIT- AT 2BG1
SEQUENTIAL:
F=0
C=0
(1.8+32)
prod=0
C* (1.8+32)
F= C * (1.8 + 32
Output of F
End
ALGORITHM (b):
W=0
W
Hourly rate
Num of hrs
F= C * (1.8 + 32
Output of Wage
End
SELECTION:
A. DESIGN AN ALGORITHM AND FLOWCHART THAT DETERMINES IF A
GIVEN NUMBER IS ODD OR EVEN.
O=0
E=0
O, E
If not divisible
by 2 output ‘odd’
End
ALGORITHM (b):
1. Define the variables: Let H be the height, let B be the base.
2. Identify the variable to be used: H=0, B=0
3. Input the value of H and B
4. Evaluate the value of hypotenuse if it exceeds or equals 10cm
and if it is less than 10cm.
5. The print perimeter of a triangle if hypotenuse exceeds 10cm,
print area of a triangle is equal to 10cm, and print “it’s all right” if
less than 10cm
Flowchart: Start
H=O
B=0
H,B
Print “Area of
triangle if hypotenuse Hypotenuse of
Print “Perimeter of
Equals 10m triangle triangle if hypotenuse
exceed 10m
End
REPETITION:
A. DESIGN AN ALGORITHM AND FLOWCHART THAT WILL
COMPUTE FOR THE SUM OF ALL EVEN NUMBERS
AMONG THE TEN(10)INPUTTED NUMBERS.
x+e x+d
x= x+a
Sum of all
even numbers
End
ALGORITHM (b):
1. Define the variables: Let N be the counter.
2. Let the counter be: N=10
3. Test the value of N. If N >1, print “hello”, or stop.
4. Increment N (N=N+1)
5. Repeat.
Flowchart: Start
N =10
PRESS 'W'
N+1
If N=10
End