Write an algorithm to input 1000 numbers. Count how many numbers are positive and how many numbers are zero. Then output the results. Use either pseudocode or a flowchart.
- (a)Write an algorithm to input 1000 numbers. Count how many numbers are positive and how many numbers are zero. Then output the results. Use either pseudocode or a flowchart.[6]
- (b)Give one change you could make to your algorithm to ensure initial testing is more manageable.[1]
Mark scheme
Marking points from the official mark scheme (May/June 2018). The mark or mark type is shown in brackets.
- [1] (a) Initialisation of counters for positive numbers and zeros
- [1] (a) Appropriate loop for 1000 iterations
- [1] (a) Input number inside loop
- [1] (a) Test for positive numbers
- [1] (a) Update positive number counter
- [1] (a) Test for zeros
- [1] (a) Update zero counter
- [1] (a) Output counters with appropriate messages outside loop
- [1] (b) Reduce the number of iterations to a manageable amount // Simulate the input (e.g. random generation)
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 →