Abstraction, decomposition, trace tables, flowcharts, efficiency. Jun 2022 Q5(a)-(d) and Jun 2023 Q4 both extensively tested algorithms.
| Term | Definition |
|---|---|
| Abstraction | |
| Decomposition | |
| Algorithmic thinking |
| Benefit | Explanation |
|---|---|
| Reusability | |
| Easier maintenance | |
| Abstraction | |
| Team development | |
| Readability | |
| Library sharing |
All arrows must be directed. No hanging symbols. Every path must lead to a terminator. (Jun 2023 Q4(c), Jun 2022 Q5(d) both asked for flowcharts.)
| Symbol | Meaning |
|---|---|
| Oval/ellipse | |
| Rectangle/parallelogram | |
| Rectangle | |
| Diamond |
Which of the following best defines abstraction in computational thinking?
Give two benefits of using subprograms (functions/procedures) in a program. (2 marks)
Complete the trace table for this algorithm:
count = 0
reject = 0
for i = 1 to 4
weight = input()
if weight < 395 OR weight > 405 then
reject = reject + 1
else
count = count + 1
end if
next i
print count, reject
Inputs: 404, 393, 395, 405
Fill in: count, reject, weight after each iteration. (4 marks)
Describe (as a list of steps) a flowchart algorithm that: takes two integers as input, and displays whether the first is greater than, equal to, or less than the second. Include all required flowchart elements. (4 marks)