COS1511 Supp 2025 exam paper — questions
69 of 70 marks extracted so far — the rest is still being read.
The paper, as written
Every question, by topic
Question 1.1 · Code tracing and variable diagrams · 2 marks
Consider the following code fragment: int x = 0; while( x < 8) cout << x << " "; x ++; cout << x << endl; What is the output of this code fragment?Show the full question
Question 1.2 · Code tracing and variable diagrams · 2 marks
Given the statements: int x, y, z; y = 10; z = 3; x = y * z - 3; What is the value of x after these statements have executed?Show the full question
Question 1.3 · Code tracing and variable diagrams · 2 marks
Given the statements: int x; x = x + 15; What is the value of x after these statements have executed?Show the full question
Question 1.4 · Strings and string functions · 2 marks
What is the output of the following code? cout << "Where is the \\" << endl;Show the full question
Question 1.5 · Code tracing and variable diagrams · 2 marks
Given the statements: int x; x = 19 % 5; What is the value of x after these statements have executed?Show the full question
The full Spot Map and the marks by year — and this paper’s scan.