Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 3 of 3.
Use the insert's operators and functions. & joins strings, MID takes part of a string, NUM_TO_STR turns a number into a string, LENGTH gives the number of characters and INT makes a whole number.
| Expression |
|---|
| MyString ← 'X' & MyString |
| MyChar ← MID("ABCD", 1, 1) |
| MyString ← NUM_TO_STR(DAY(MyDOB)) |
| MyInt ← INT(LENGTH(MyString) / 2) |
Row 1: & [1]
Row 2: MID with a start position 1, 2, 3 or 4 and length 1 [1]
Row 3: NUM_TO_STR with DAY, MONTH, YEAR or DAYINDEX [1]
Row 4: INT and LENGTH [1]
| Test description | Test method |
|---|---|
| carried out as soon as a program module has been coded | alpha |
| carried out as program modules are being combined | integration |
| completed by the developers without referring to the code | black-box |
| completed by the customer | acceptance (or beta) |
Integration [1]
Black-box [1]
Acceptance (or beta) [1]
Name two features and say what each does:
A breakpoint stops the program at a chosen line or statement, so the variables can be looked at in the report window [1]
Single stepping runs one line or statement at a time, so the report window shows how the variables change after each line [1]
Explanation of both: one stops the program at a chosen line, the other runs one line at a time, to locate the error [1]
▶ Whole paper
Video solution of the whole paper · by CSFeedbySirNisarAli. 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.