Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

COMPUTER FUNDAMENTALS AND PROGRAMMING

Mary Hazel Medes


BSGE – 1B
ALGORITHM AND FLOWCHART EXERCISE
INSTRUCTION: DETERMINE THE APPROPRIATE FLOWCHART OF ALGORITHM AND VISE
VERSA.
DETERMINE THE FLOWCHART OF THE FOLLOWING ALGORITHM
1. Print 1 to 20
Algorithm:
Step 1: Initialize X as 0,
Step 2: Increment X by 1,
Step 3: Print X
Step 4: If X is less than 20 then go back to step 2.

Flowchart: Start

Initialize X as 0

Increment X by 1

Print X

X<20?

End

2. Convert Temperature from Fahrenheit (°F) to Celcius (°C)


Algorithm:
Step 1: Read temperature in Fahrenheit,
Step 2: Calculate temperature with formula C = 5/9*(F – 32),
Step 3: Print C
Start
Flowchart:

Read °F

𝐶 = 5/9 ∗ (𝐹 − 32)

Print C

End
3. Determine whether a student passed the exam or not.
Algorithm:
Step 1: Input grades of 4 courses M1, M2, M3, and M4,
Step 2: Calculate the average grade with formula “Grade = (M1+M2+M3+M4)/4”,
Step 3: If the average grade is less than 60, print “FAIL”, else print “PASS”.

Flowchart:
Start

Input M1, M2,


M3, M4

𝑀1 + 𝑀2 + 𝑀3 + 𝑀4
𝐺𝑟𝑎𝑑𝑒 =
4

Average<60?

Y N

Print “FAIL” Print “PASS”

End

DETERMINE THE ALGORITHM OF THE FOLLOWING FLOWCHART


4. Determine whether a temperature is below or above the freezing point.
Flowchart:
Algorithm:
Step 1: Read Temperature
Step 2: If the temperature is less than 32, print “Below Freezing”, else print “Above Freezing”.

5. Calculate the interest of a Bank Deposit


Flowchart:

Algorithm:
Step 1: Read amount,
Step 2: Read years,
Step 3: Read rate,
∗ ∗
Step 4: =
Step 5: Print interest.

You might also like