Algorithm Activity
Algorithm Activity
Algorithm Activity
ALGORITHM ACTIVITY
For each of the problem, analyze it using IPO table, then write the algorithm.
(Pseudo code and flowchart).
IPO
Step/Solution algorithm:
FLOWCHART
START
PSEUDO CODE
1. Start
Input pi,
2. Get input Read pi (π) input radius
Read radius
END
Problem 2: Calculate the temperature in Celsius.
Temperature in Fahrenheit will be entered.
IPO
Step/Solution algorithm:
FLOWCHART
START
PSEUDO CODE
1. Start
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.
IPO
Display output
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;
END