Section B 2 (a) Draw a flowchart for an algorithm to input numbers. Reject any numbers that are negative and count how many numbers are positive. When the number zero is input, the process ends and the count of positive numbers is output.
- (a)Draw a flowchart for an algorithm to input numbers. Reject any numbers that are negative and count how many numbers are positive. When the number zero is input, the process ends and the count of positive numbers is output.[6]
- (b)Explain the changes you will make to your algorithm to also count the negative numbers.[2]
Mark scheme
Marking points from the official mark scheme (May/June 2018). The mark or mark type is shown in brackets.
- [6] One mark per correct pair of actions, process, Input/Output, Tests (apart from START and END) max 3
- One mark complete Flowlines, one mark working flowlines, one mark correct use flowchart symbols
- START Count ← 0 INPUT Number Is Number = 0? Yes OUTPUT Count, " positive numbers" END No Is Number < 0? No Yes Count ← Count + 1
- [2] Any two from:
- • Use another counter/variable
- • Update this counter/variable when the number is less than zero/count all numbers and subtract the positive numbers
- • Output this counter/variable at the end // Output both counters at the end
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →