Name: MANANSALA, JV ANGELO M.
Grade & Section: BSIT – 1A
ALGORITHM ACTIVITY
For each of the problem, analyze it using IPO table, then write the algorithm.
(Pseudo code and flowchart).
Problem 1: Calculate the area of one circle.
IPO
INPUT PROCESS OUTPUT
Input Variable: Processing Item: area Output:
pi (π) radius Formula area
area = pi (radius * radius)
Step/Solution algorithm:
Get the input Calculate the
area of a circle.
Display the output
FLOWCHART
START
PSEUDO CODE
1. Start
Input pi,
2. Get input Read pi (π) input radius
Read radius
3. Calculate the area of a circle Calculate Area
area = pi (radius * radius) area = pi (radius * radius)
4. Output the area of a circle
Print area
5. End
END
Problem 2: Calculate the temperature in Celsius.
Temperature in Fahrenheit will be entered.
The formula is;
Temperature in Celsius = 5/9 (temperature in Fahrenheit – 32)
IPO
INPUT PROCESS OUTPUT
Input Variable: Processing Item: temp_celcius Output:
Temp Fahrenheit Formula temp_celcius
temp_celcius = 5/9
(Temp Fahrenheit - 32)
Step/Solution algorithm:
Get the input Calculate the
temperature in Celsius.
Display the output
FLOWCHART
START
PSEUDO CODE
1. Start
2. Get the input temp_fahrenheit
Read temp_fahrenheit.
3. Calculate the temperature in
Celsius temp_celcius = 5/9 Calculate temperature in Celsius
(temp_fahrenheit - 32) temp_celcius = 5/9
(temp_fahrenheit - 32)
4. Display the output
5. End
Print temp_celcius
END
Problem 3: Calculate the final mark for a student who took CS118 paper.
The final mark is the total of on-going assessment (carry mark) and 60% of final exam.
The carry mark is calculated as follow:
Carry mark = 20% of test mark + 20% of quiz mark
IPO
INPUT PROCESS OUTPUT
Input Variable: Processing Item: final_mark Output:
test_mark Formula: final_mark
quiz_mark test_mark = test_mark * 0.20;
final_exam quiz_mark = quiz_mark * 0.20;
carry_mark = test_mark + quiz_mark;
final_exam = final_exam * 0.60;
final_mark = carry_mark + final_exam;
Step/ Solution algorithm:
Get input Calculate the final_mark.
Display output
PSEUDO CODE FLOWCHART
START
1. Start
2. Get Input Read test_mark
Read test_mark Read quiz_mark
Read quiz_mark Read final_exam
Read final_exam
3. Calculate final_mark
test_mark = test_mark * 0.20;
test_mark = test_mark * 0.20;
quiz_mark = quiz_mark * 0.20;
quiz_mark = quiz_mark * 0.20;
carry_mark = test_mark + quiz_mark;
carry_mark = test_mark + quiz_mark;
final_exam = final_exam * 0.60;
final_exam = final_exam * 0.60;
final_mark = carry_mark + final_exam;
final_mark = carry_mark +final_exam;
4. Display output final_mark
Print
5. End final_mark
END