Cambridge O Level Computer Science 2210 · 8.1 Programming concepts

Q16 · 2210/21/M/J/23 Q4

Worked solution from the Programming Paper 2 Algorithms, Programming and Logic booklet, Part 1 of 3.

Q162210/21/M/J/23original Q4Structured · 4 marks
Question 4 from 2210/21/M/J/23

Worked solution

DIV

DIV does integer division. [1]

Only the whole-number part of the answer is kept, so the remainder is thrown away. [1]

Example: DIV(9, 4) = 2

ROUND

ROUND gives a number rounded to a stated number of decimal places. [1]

It goes up or down depending on the next digit: 5 or more rounds up, less than 5 rounds down. [1]

Example: ROUND(4.56, 1) = 4.6

KEY IDEADIV keeps the whole number of a division; ROUND shortens a number to a set number of decimal places.
TOTAL 4 marks

Official mark scheme

Mark scheme for 2210/21/M/J/23 question 4
VIDEO
▶ Whole paper

Video solution of the whole paper · by ZAINEMATICS. Tap the picture to open it on YouTube.

Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.