Past-paper question · 2025 October-November · Paper 41 · Q1(e)
Question 1(e) 2025 · October-November · Paper 41 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 1
Part (e)
Question 1
mark each
Question 4
- Procedure header (and end) and output of highest and lowest include appropriate messages
- Calls Pop() until there are no items left in stack (return value = –999 // TopOfStack = -1) and
✓
storing/using return values
- Finds and outputs highest value from returned values
- Finds and outputs lowest value from returned values
✓
Example program code
✓
Java
✓
public static void FindValues(){
✓
Integer Highest;
✓
Integer Lowest;
✓
Highest = Pop();
✓
Lowest = Highest;
✓
Integer ReturnValue = Highest;
✓
while(ReturnValue != -999){
✓
if(ReturnValue > Highest){
✓
Highest = ReturnValue;
✓
}
✓
if(ReturnValue < Lowest){
✓
Lowest = ReturnValue;
✓
}
✓
ReturnValue = Pop();
✓
}
✓
System.out.println("The highest value is " + Highest + " and the lowest value is " +
✓
Lowest);
✓
}
✓
9618/41
✓
Cambridge International AS & A Level – Mark Scheme
✓
October/November 2025
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks
Show text version of question
Question 1
Part (e)
Question 1
A program stores integers in a stack. The stack is represented as a 1D array of 30 elements with
the identifier Stack
The global pointer TopOfStack stores the index of the last element inserted into the stack. TopOfStack is initialised to –1
Part (e)
The procedure FindValues():
- pops each integer from the stack until the stack is empty
- finds and outputs the largest number that was in the stack in an appropriate message
- finds and outputs the smallest number that was in the stack in an appropriate message.
Write program code for FindValues()
Save your program.
Copy and paste the program code into part 1(e) in the evidence document.
[4]
Topic relevance
Why this question appears here
82% assigned-topic match · Programming › Constructs
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9618_w25_qp_41.pdf
Keep practising this topic
Related searches for this question
Computer Science For First Examination In 2021 9618 topical past papers
Computer Science For First Examination In 2021 9618 topical questions with answers
AS & A Level Computer Science For First Examination In 2021 topical past papers
Computer Science For First Examination In 2021 9618 Programming topical questions
Constructs past paper questions
Computer Science For First Examination In 2021 9618 2025 October-November question
