A program is a set of instructions a computer can follow. An algorithm is the plan of those steps, written so a person can check it before the code is typed.
The idea
Write the steps in the order they must happen. That order is sequence. Selection chooses a path: if a condition is true, do one thing, otherwise do another. Repetition does a step again until a condition changes, such as "while the list still has a name, print the next name". A variable is a named place that holds a value the program can change. A constant is a named value that should not change while the program runs. Use a name that says what the value is. Total is clearer than X when the value is a total.
A flow chart draws the same plan with symbols: a rectangle for a process, a diamond for a decision, and arrows for the order. The chart and the written steps must agree. Dry run the steps with a small set of numbers before you trust them. Write down the value of each variable after each step. If the result is wrong, the error is in the order or in the condition, and you can see which line caused it. A programming language is the form the computer runs. The algorithm is the idea. The language is how you express it. The idea has to be right first.
The ICT tips guide sets out the papers, the practical, and the mistakes that cost marks. WASSCE ICT tips
What earns the marks
Sequence, selection and repetition are three different marks. A list of steps with no decision is sequence only. If the question asks for a decision, the condition has to be visible: what is tested, and what happens in each case. A variable that is used before it is given a value is an error. Show the first value. A dry run that jumps to the final number with no line of working hides the method. The method is the mark.
Practice questions
These are practice questions in the style of the paper, with a model answer and a mark scheme. They are not a promise of what your paper will ask.
1Question 1
4 marks
A program must print "Pass" when a mark is 50 or more, and "Fail" otherwise.
(a) Name the control structure this uses. (1 mark)
(b) Write the steps. (3 marks)
Model answer
(a) Selection.
(b) Read the mark. If the mark is 50 or more, print Pass. Otherwise print Fail.
Mark scheme
Selection, or a decision1 mark
The mark is read or known1 mark
Pass when the mark is 50 or more1 mark
Fail in the other case1 mark
2Question 2
2 marks
Distinguish between a variable and a constant. (2 marks)
Model answer
A variable is a named value the program can change. A constant is a named value that stays the same while the program runs.
Mark scheme
A variable can change1 mark
A constant stays the same1 mark
3Question 3
3 marks
A variable count starts at 0. The step "add 1 to count" runs three times. What is count at the end, and why is the starting value needed? (3 marks)
Model answer
Count is 3. The starting value is needed because the first addition has to know what it is adding to. Without 0, the first step has no number to increase.
Mark scheme
31 mark
The additions are 1, then 2, then 3, or three increases from 01 mark
The first step needs a starting number1 mark
Practise ICT with Anna
More questions on this topic are inside glearn, marked as you answer, with the reason written out. The first ones need no account.
What is the difference between an algorithm and a program?+
An algorithm is the plan of the steps, written so a person can check the order and the decisions. A program is those steps in a language the computer can run. The plan should be right before the code is typed.
What are sequence, selection and repetition?+
Sequence is steps in order. Selection is a decision: if a condition is true, do one path, otherwise do the other. Repetition does a step again until a condition changes. A real task often uses all three. All WASSCE ICT past questions