An algorithm is needed to process a sequence of numbers. Numbers may be positive or negative and may be integer or decimal. The algorithm will: • prompt and input one number at a time until the value zero is input • sum the negative numbers • sum the positive numbers • when zero is input, output the two sum values and then end. Describe the algorithm needed. Do not include pseudocode statements in your answer.
- An algorithm is needed to process a sequence of numbers. Numbers may be positive or negative and may be integer or decimal. The algorithm will: • prompt and input one number at a time until the value zero is input • sum the negative numbers • sum the positive numbers • when zero is input, output the two sum values and then end. Describe the algorithm needed. Do not include pseudocode statements in your answer.[5]
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2022). The mark or mark type is shown in brackets.
- [5] One mark per point, for example: 1 Declare two (REAL) variables for the two sum values AND initialise both to zero 2 Prompt AND Input a number 3 If number greater than zero add to positive sum and If number less than zero add to negative sum 4 Repeat from step 2 if number not zero 5 After loop the Output SumPos and SumNeg
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 →