Flow Charts-Looping
Flow Charts-Looping
A. Flow Charts
Write an algorithm and draw the flowchart for each of the following:
1. Draw a flowchart that will compute for the perimeter of the circle. Given the formula
P = 2*pi*R
Where P is the perimeter, r is the radius.
2. An Auto mobile starts from rest then runs at a speed of a km/hr. Draw a flowchart that will compute for the total
distance traveled if the automobile had been traveling for t hours. Use the formula d=v0t + (at2)/2
3. Draw a flowchart that that will identify if a number entered is negative or positive.
4. Draw a flowchart that will accept three numbers and determines which is the highest and which is the lowest.
2. Decision (if..then..else)
Part of the flowchart that employs two or more possible alternative solution and one of which will be chosen for
execution depending on the value of the given condition.
Example:
Designing a Loop
There are three things to consider in designing a loop:
1. The body
2. The initializing statement
3. The conditions for terminating a loop
3. Draw a flowchart that accepts 5 numbers. Determine if the numbers entered are odd or even. Compute for the total of
all odd numbers, all even numbers, and the total of all numbers.
So Se St C n
0 0 0 1 5
5 0 0 2 4
5 4 0 3 8
5 12 0 4 11
16 12 0 5 7
23 12 35