An algorithm will: 1. prompt and input a sequence of 100 integer values, one at a time 2. sum the positive integers 3. output the result of the sum.
- (a)Write pseudocode for the algorithm. Assume the value zero is neither positive nor negative. You must declare all variables used in the algorithm.[5]
- (b)The algorithm requires the use of basic constructs. One of these is sequence. Identify one other basic construct required by the algorithm and describe how it is used. Construct Use[2]
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2024). The mark or mark type is shown in brackets.
- [1] MP1 Declarations of all variables used
- [1] MP2 Loop for 100 iterations
- [1] MP3 Prompt and input a value in a loop and
- [1] MP4 Test for value > 0 // >=1 in a loop
- [1] MP5 Sum the Total in a loop
- [1] MP6 Output of Total after the loop
- [1] MP1 Construct: Iteration / Repetition
- [1] MP2 Use: To loop through all 100 inputs // To loop 100 times
- [1] ALTERNATIVE: MP1 Construct: Selection
- [1] MP2 Use: To test whether the value input is positive
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 →