1.4: Unit Summary
- Page ID
- 48197
In this unit, you have seen what an algorithm is. Based on this knowledge, you should now be able to characterize an algorithm by stating its properties. We have explored the different ways of representing an algorithm such as using human language, pseudo codes and flow chart. You should now be able to present solutions to problems in form of an algorithm.
The following section will test the learners understanding of this unit.
Unit Revision
Instructions
Answer the following questions.
- Design an algorithm to add two numbers and display result.
- Write pseudocode to input the dimensions of a rectangle and print area and perimeter.
- Give an algorithm to find the maximum number.
- Feedback
-
- Can be written as below:
step 5 − STOP
- The pseudocode is:
read length, breadth area = length * breadth perimeter = 2*(length+breadth) display area, perimeter
- The solution is:
Pick up the first number and suppose it is maximum.
Pick up a number from the remaining numbers.
Compare the picked number and current maximum.
Throw out the smaller and suppose the larger one as the new maximum.
Repeat 2~4 until there’s no number remaining.
Output the current maximum.
- Can be written as below:
Grading Scheme
The marks will be awarded as shown below
question | sub-question | marks awarded |
---|---|---|
1 | 2 | |
2 | Any property listed award 1 mark, and explanation another 1 mark | 6 |
3 | Each term correctly stated to be awarded 1 mark (maximum 6 statements) | 6 |
Total | 14 |
Unit Readings and Other Resources
The readings in this unit are to be found at course level readings and other resources.