An original Thinka practice paper modelled on the structure and difficulty of the Jun 2025 OCR GCSE (9-1) Computer Science - J277 paper. Not affiliated with or reproduced from OCR.
Section J277/01 — All questions
Answer all six main questions. No calculator. The asterisked extended response assesses quality of reasoning.
27 Question · 80 marks
Question 1 · Calculation and representation
2 marks
A technician records a colour value for a lighting panel as the 8-bit binary number 10110101.
(a) Convert 10110101 into hexadecimal. Show your working. [2]
Show answer & marking schemeHide answer & marking scheme
Worked solution
Split the 8 bits into two nibbles: 1011 and 0101. 1011 = 8 + 2 + 1 = 11 = B. 0101 = 4 + 1 = 5. So the hexadecimal value is B5.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | (a) | Splits into nibbles 1011 and 0101 // shows 11 and 5 as denary values (1) | 1 | Accept correct working via denary (181) only if converted correctly to hex. | | | B5 (1) | 1 | Allow b5. Do not accept 11 5 or 115. Award both marks for B5 with no working. |
Question 2 · Calculation and representation
2 marks
A game stores a score as the 8-bit binary number 00001101.
(a) Perform a binary shift two places to the left on 00001101. Write the 8-bit result. [1]
(b) State the effect this shift has on the value of the number. [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
(a) Moving every bit two places left and filling the right with zeros gives 00110100. (b) 00001101 is 13 and 00110100 is 52, so the value has been multiplied by 4 (each place left multiplies by 2).
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | (a) | 00110100 (1) | 1 | Must be 8 bits. Do not accept 110100 . | | (b) | Multiplied by 4 (1) | 1 | Accept multiplied by 2 twice // doubled twice. Do not accept 'multiplied by 2' alone or 'increases'. |
Question 3 · Calculation and representation
2 marks
A museum stores a 30 second audio guide clip. The clip was recorded with a sample rate of 8000 Hz and a bit depth of 16 bits.
(a) Calculate the file size of the clip in bytes. Show your working. No metadata is included. [2]
Show answer & marking schemeHide answer & marking scheme
Worked solution
File size in bits = sample rate x duration x bit depth = 8000 x 30 x 16 = 3 840 000 bits. Divide by 8 to convert to bytes: 3 840 000 / 8 = 480 000 bytes (480 KB).
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | (a) | 8000 x 30 x 16 = 3 840 000 (bits) (1) | 1 | Method mark. | | | 3 840 000 / 8 = 480 000 bytes (1) | 1 | Accept 480 KB // 480 000 B. Allow follow-through from one arithmetic slip in the first step for the division mark only. Award both marks for 480 000 with no working. |
Question 4 · Calculation and representation
4 marks
A wildlife charity records bird calls with a handheld digital recorder. One recording has these properties:
(a) Calculate the size of the sound file in kilobytes (KB). Show each stage of your working. [3]
(b) The charity re-records the call using a bit depth of 8 bits and keeps the other properties the same. Describe the effect on the file size and on the sound quality. [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
(a) File size in bits = sample rate x duration x bit depth = 8000 x 15 x 16 = 120 000 x 16 = 1 920 000 bits. Convert to bytes: 1 920 000 / 8 = 240 000 bytes. Convert to kilobytes: 240 000 / 1000 = 240 KB. (b) Halving the bit depth halves each sample's storage, so the file becomes 120 KB (half the size), but each sample is recorded less precisely so the quality is lower.
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | (a) | Multiplies 8000 x 15 x 16 // correct calculation of 1 920 000 (bits) | 1 | Allow 1 mark for correct method with an arithmetic slip. | | (a) | Divides by 8 to convert bits to bytes (240 000 bytes) | 1 | Follow through from the candidate's bit value. | | (a) | Divides by 1000 to give 240 KB | 1 | Accept 234.375 KB if 1024 is used consistently. Answer only: 240 KB gets 3 marks; do not accept an answer with no units. | | (b) | File size is smaller/halved AND quality is lower/less accurate | 1 | Both points are required for the mark. Do not accept 'quality is worse' alone without the size effect. Ignore any reference to sample rate. |
Total: 4 marks
Question 5 · Completion
6 marks
A technician is documenting values stored in the memory of a weather-logging device. Each value is shown in three number systems.
Complete the table. Each row gives one value; fill in the two empty boxes in that row. Show any working in the space beside the table.
Calculate the size of the sound file in kilobytes (KB). Show your working. [3]
Show answer & marking schemeHide answer & marking scheme
Worked solution
File size in bits = sample rate x duration x bit depth = 8,000 x 40 x 16 = 320,000 x 16 = 5,120,000 bits. Convert to bytes: 5,120,000 / 8 = 640,000 bytes. Convert to kilobytes: 640,000 / 1,000 = 640 KB (or 625 KB if 1,024 is used).
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1 | Multiplies sample rate x duration x bit depth // 8,000 x 40 x 16 // to get 5,120,000 (bits) | 1 | Allow 320,000 as an intermediate value if later multiplied by 16. | | | Divides bits by 8 to get bytes // 640,000 (bytes) | 1 | Follow through from an incorrect bit total. | | | Divides bytes by 1,000 to give 640 (KB) | 1 | Accept 625 (KB) if bytes are divided by 1,024 // accept 625 or 640 with correct working. Do not accept the answer without units unless working is clearly in KB. Correct answer with no working: max 1 mark... award 3 only if working is shown. |
Question 7 · Developed response
3 marks
A pupil types the web address www.kestrelbooks.example into a browser on a school computer.
Describe how the Domain Name System (DNS) allows the browser to obtain the web page. [3]
Show answer & marking schemeHide answer & marking scheme
Worked solution
The URL is sent to a domain name server. The DNS looks up the domain name in its records and returns the matching IP address (asking another domain name server if it does not hold the record). The browser then uses the IP address to send a request to the web server that hosts the site, which returns the page.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 2 | The URL / domain name is sent to a (domain name) server // DNS server | 1 | Do not accept the browser 'knowing' the address without a lookup. | | | The DNS finds / looks up the matching IP address // converts the URL / domain name into an IP address | 1 | Accept the request is passed to another DNS server if the record is not held. | | | The IP address is returned and used to contact / request the page from the web server | 1 | Allow 'the browser connects to the website'. Ignore references to MAC addresses. max 3 |
Question 8 · Developed response
4 marks
A wildlife charity records bird song on a handheld recorder. One recording is stored using the following settings:
(a) Calculate the file size of the recording in bytes. Show your working. [3]
(b) The charity doubles the sample rate for later recordings. State one effect this has on the recording. [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
(a) Size in bits = sample rate x duration x bit depth = 8 000 x 5 x 16 = 40 000 x 16 = 640 000 bits. Divide by 8 to convert to bytes: 640 000 / 8 = 80 000 bytes (80 KB). (b) With twice as many samples per second, the file size doubles and the stored sound is closer to the original.
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | (a) | Multiplies 8 000 x 5 x 16 // correct method for bits | 1 | Accept 640 000 for the mark below as evidence of this mark. | | (a) | 640 000 (bits) | 1 | | | (a) | Divides by 8 to give 80 000 bytes | 1 | Accept 80 KB // 80 000 B. Accept 78.125 KB if 1 024 is used. Allow follow-through for the division by 8 if the bits value is wrong, provided the method was correct. | | (b) | File size doubles // better quality / more accurate / closer to the original sound | 1 | Do not accept 'louder' or 'sounds longer'. max 1 |
Question 9 · Developed response
4 marks
A small school library has ten computers. They are connected in a star topology using one central switch.
Explain two advantages of using a star topology for the library network. [4]
Show answer & marking schemeHide answer & marking scheme
Worked solution
Advantage 1: If one cable fails, only the computer using that cable loses its connection, so the other nine computers continue to work. Advantage 2: The switch sends data only to the computer it is addressed to, so there are fewer data collisions and performance is consistent when many computers are in use. Other valid advantage: a new computer can be added by connecting one cable to the switch without stopping the network.
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | | Award 1 mark for each advantage identified and 1 mark for a linked development, up to 2 advantages. | 4 | max 4 | | | Failure of one cable / device does not affect the others... so the rest of the network keeps working | 2 | | | | Data is sent only to the intended device by the switch... so fewer collisions // better / more consistent performance | 2 | | | | Easy to add / remove devices... without disrupting the network | 2 | | | | Easy to locate faults... because each device has its own cable to the centre | 2 | | | | Guidance | | The development mark depends on the advantage being given. Do not accept 'faster' or 'cheaper' alone. Do not accept advantages of mesh topology. Do not accept a disadvantage.
Question 10 · Developed response
4 marks
A warehouse system uses tag codes. A tag code is valid only if it has exactly 5 characters and its first character is "Z".
Write a function, using the OCR Exam Reference Language or a high-level programming language, that: - is named checkTag - takes one parameter, a string tag - returns True if the tag code is valid - returns False if it is not valid.
You do not need to check whether the characters after the first are letters or digits. [4]
Show answer & marking schemeHide answer & marking scheme
Worked solution
function checkTag(tag) if tag.length == 5 AND tag.left(1) == "Z" then return True else return False endif endfunction
The length is tested with .length, the first character with .left(1) (or .substring(0,1)), and both conditions are joined with AND so both must be true.
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | | Function header with name checkTag and one parameter, and closed correctly (endfunction) | 1 | Allow a high-level language equivalent. | | | Checks the length is 5 | 1 | tag.length == 5 // len(tag) == 5 in a high-level language. | | | Checks the first character is "Z" | 1 | Accept .left(1) // .substring(0,1) // tag[0] // equivalent. Do not accept comparing the whole string to "Z". | | | Both conditions combined correctly (AND) and True returned when both are met and False otherwise | 1 | Accept a single return of the condition itself, e.g. return tag.length == 5 AND tag.left(1) == "Z". Accept nested if statements. Do not accept OR. Minor syntax errors are not penalised. Pseudocode in natural English or bullet points earns no marks. |
Question 11 · Developed response
4 marks
A booking program asks the user to enter the number of tickets to buy. The program must only accept whole numbers from 1 to 20 inclusive.
Complete the test plan by giving one suitable test value for each type of test data. The values must be different from each other.
| Type of test data | Test value | |---|---| | Normal | | | Boundary | | | Invalid | | | Erroneous | |
[4]
Show answer & marking schemeHide answer & marking scheme
Worked solution
Normal: a value inside the range, such as 7. Boundary: a value at the edge of the valid range, such as 20 (or 1). Invalid: the correct data type but outside the range, such as 35. Erroneous: the wrong data type, such as "ten" or 4.5.
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | | Normal: whole number from 2 to 19 | 1 | | | | Boundary: 1 or 20 | 1 | Allow 0 or 21 as boundary values on the edge of the invalid range. | | | Invalid: whole number below 0 or above 21 (e.g. 35, -3) | 1 | Do not accept a number already used for another row. Accept 0 or 21 only if not used as the boundary value. | | | Erroneous: a value that is not a whole number, e.g. "ten", 4.5, a letter | 1 | Accept a symbol or blank entry. |
Question 12 · Developed response
4 marks
A museum scans old maps and stores each scan as a bitmap image file. One scan is 400 pixels wide and 250 pixels high. Each pixel is stored using a colour depth of 8 bits.
(a) Calculate the file size of the scan in kilobytes (KB). Show your working. Use 1 KB = 1,000 bytes. Ignore metadata. [2]
Show answer & marking schemeHide answer & marking scheme
Worked solution
(a) Number of pixels = 400 × 250 = 100,000. Size in bits = colour depth × height × width = 8 × 100,000 = 800,000 bits. Divide by 8 to get bytes: 100,000 bytes. Divide by 1,000 to get kilobytes: 100 KB. (b) Each pixel now uses 4 bits instead of 8, so the file size is halved (50 KB). With 4 bits only 16 colours can be represented instead of 256, so colours are less accurate and the image quality is reduced.
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | (a) | Calculates total bits as 400 × 250 × 8 // 800,000 (bits) | 1 | Allow 100,000 pixels × 8 as working. | | (a) | Converts to 100 KB (100,000 bytes ÷ 1,000) | 1 | Allow 97.65... KB // 97.66 KB if 1,024 is used and working shown. Allow follow-through for the conversion mark from an incorrect bit total only if the bits-to-bytes and bytes-to-KB steps are correct. Answer of 100 with no working scores 2. | | (b) | File size decreases // is halved // is 50 KB // fewer bits per pixel | 1 | Do not accept 'smaller image' or 'fewer pixels'. | | (b) | Fewer colours can be represented // lower image quality // less accurate colours | 1 | Accept 16 colours instead of 256. Ignore 'resolution is reduced'. |
Max 4 marks.
Question 13 · Developed response
5 marks
A veterinary clinic has eight computers in its reception, consulting rooms and office. The computers are connected to one another and to a shared printer in a Local Area Network (LAN). The clinic manager has chosen a star topology instead of a mesh topology.
(a) Identify the device that is placed at the centre of a star network. [1]
(b) Explain two reasons why a star topology is more suitable than a mesh topology for the clinic. [4]
Show answer & marking schemeHide answer & marking scheme
Worked solution
(a) The central device in a star network is a switch, which receives data from each computer and forwards it only to the device it is addressed to.
(b) In a star network every device has one cable to the switch. In a mesh network each device is connected to several or all of the others. For eight computers a full mesh needs 28 cables, whereas a star needs 8. So a star is cheaper and quicker to install. A new computer can be added by running a single cable to the switch without altering other connections. If one cable fails, only the device on that cable loses its connection, so the rest of the clinic can carry on working, and the fault is easy to find.
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | 1(a) | Switch | 1 | Accept hub // central switch. Do not accept router, server or WAP. | | 1(b) | Reason 1 identified: fewer cables are needed (1) // Development: so it is cheaper / quicker / simpler to install (1) | max 4 | Each reason must be a different point. Award the second mark of a pair only if it develops the stated reason (linked points). Max 2 per reason. | | | Reason 2 identified: a new device can be added easily (1) // Development: only one cable to the central switch is needed and the rest of the network is not affected (1) | | Other valid reasons: a cable failure affects only one device (1) so the other computers keep working (1); easier to locate faults because each device has its own cable (1) because the problem can be traced to one connection (1); less data collision because the switch sends data only to its destination (1) so performance is maintained (1). | | | | | Do not accept 'cheaper' alone without a reason for it being cheaper in the development mark. Do not accept 'faster' alone. Ignore statements that a star has no single point of failure. Benefit of the doubt: allow 'less wire' for 'fewer cables'. Max 4 for (b). | | | Total | 5 | |
Question 14 · Extended discussion
8 marks
6* Harbourview Academy plans to replace its canteen payment cards with a fingerprint scanner system. Each student's fingerprint data will be stored on a server in the school and linked to an online account that parents top up. The scanners connect to the server over the school network.
Discuss the ethical, legal and privacy issues that the school should consider before introducing this system. [8]
Show answer & marking schemeHide answer & marking scheme
Worked solution
A good answer weighs both sides in the context of a school canteen.
Ethical: students and parents may not want to give biometric data; a fair alternative (e.g. PIN or card) should be offered so no one is disadvantaged; children may become used to being monitored. Benefits: cards cannot be lost or borrowed, queues are quicker, and students receiving free meals are not identifiable by a different card.
Privacy: a fingerprint cannot be changed if stolen, so a breach has lasting effects. The data is personal and sensitive, so it should be stored securely (encryption, access levels, firewall) and only used for payment.
Legal: under the Data Protection Act 2018 the school must have a lawful reason and permission, keep the data secure and accurate, collect only what is needed, delete it when a student leaves, and let people see the data held about them. If a hacker accessed the server, they would break the Computer Misuse Act 1990.
Conclusion: the system can be justified if consent, an opt-out, strong security and deletion rules are in place.
Marking scheme
Question 6* | Marks: 8 | Marked holistically using three bands. Indicative content is illustrative, not exhaustive.
Band 3 (6-8 marks): Detailed, accurate discussion covering at least two of ethical, legal and privacy issues, with both advantages and disadvantages. Points are clearly applied to the school/canteen scenario and linked with reasoning (e.g. fingerprint cannot be changed, so a breach is serious, so encryption and deletion are needed). A balanced, coherent conclusion or judgement is reached. Technical terms are used correctly. Top of band for all three areas with a developed judgement.
Band 2 (3-5 marks): Some accurate discussion of at least two issues, with some application to the scenario. Reasoning may be partial, one-sided or limited in development. Some use of terminology. A conclusion may be missing or weak.
Band 1 (1-2 marks): Basic, mostly generic statements about one or two issues (e.g. 'it is an invasion of privacy', 'the data could be hacked') with little or no application or reasoning.
Band 0 (0 marks): No creditable response.
Indicative content: - Ethical: consent from students/parents; alternative for those who object; fairness; surveillance of children; avoids stigma for free-meal students; no cards to lose or share. - Privacy: biometric data is personal/sensitive; cannot be changed if stolen; who can access it; how long it is stored; risk of data theft or interception over the network; security measures such as encryption, firewall, user access levels, physical security of the server. - Legal: Data Protection Act 2018 - data used lawfully and fairly, only for stated purpose, adequate and not excessive, accurate, not kept longer than necessary, kept secure, not shared without permission, individuals can see their data; Computer Misuse Act 1990 - unauthorised access to the server is illegal.
Guidance: Accept: any valid, relevant point worded differently. Allow: reference to Data Protection principles without naming the exact wording. Do not accept: Acts named but with incorrect purpose (e.g. Copyright, Designs and Patents Act 1988 applied to fingerprints). Ignore: discussion of how the fingerprint scanner hardware works. Max 5 marks if only one of ethical/legal/privacy is covered, or if no scenario application is shown.
Question 15 · Selected response
1 marks
A technician records the binary number 10110100 for a sensor reading.
Which one of the following is the same value written in hexadecimal?
Tick (✓) one box.
[ ] A 4B [ ] B B4 [ ] C D2 [ ] D A4 [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
Split the 8 bits into two nibbles: 1011 and 0100. 1011 = 8 + 2 + 1 = 11 = B. 0100 = 4. So the hexadecimal value is B4.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1 | B (B4) | 1 | Do not award the mark if more than one box is ticked. Accept the answer written as B4 instead of a tick. |
Question 16 · Selected response
1 marks
An employee writes an email on their laptop and presses Send.
Which one of the following protocols is used to send the email from the laptop to the email server?
Tick (✓) one box.
[ ] A POP [ ] B SMTP [ ] C FTP [ ] D HTTPS [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
SMTP (Simple Mail Transfer Protocol) is used to send email to a server. POP retrieves email, FTP transfers files and HTTPS is used for secure web pages.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 2 | B (SMTP) | 1 | Do not award the mark if more than one box is ticked. Accept the answer written as SMTP instead of a tick. |
Question 17 · Selected response
4 marks
A museum stores digital images, sound recordings and text labels for its exhibits.
Tick (✓) the FOUR statements that are true.
| Statement | Tick (✓) | |---|---| | A. Increasing the sample rate of a sound recording increases its file size. | [ ] | | B. Reducing the colour depth of an image increases its file size. | [ ] | | C. A bit depth of 8 allows each sound sample to take one of 256 different values. | [ ] | | D. The metadata of an image file can include the width and height of the image. | [ ] | | E. Lossy compression allows the original file to be rebuilt exactly. | [ ] | | F. Doubling the number of pixels in an image, with the same colour depth, halves its file size. | [ ] | | G. Unicode can represent more different characters than 8-bit ASCII. | [ ] | | H. A nibble is a group of 8 bits. | [ ] |
[4]
Show answer & marking schemeHide answer & marking scheme
Worked solution
A is true: more samples per second means more data. B is false: lower colour depth means fewer bits per pixel, so a smaller file. C is true: \(2^8 = 256\). D is true: width and height are stored as metadata. E is false: lossy compression permanently removes data. F is false: doubling the pixels doubles the file size. G is true: Unicode uses more bits per character, so has a larger character set. H is false: a nibble is 4 bits. The four true statements are A, C, D and G.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1 | A ticked | 1 | | | | C ticked | 1 | | | | D ticked | 1 | | | | G ticked | 1 | Max 4. If more than four boxes are ticked, remove one mark for each tick beyond four (minimum 0 marks). Accept any clear unambiguous indication of selection, e.g. a cross, if the candidate's intention is clear. Ignore a box that is ticked and then clearly crossed out.
Question 18 · Selected response
5 marks
A museum stores its audio guides and visitor information as digital data.
For each part, tick (✓) the box or boxes as instructed.
1 (a) The museum stores a room number as the 8-bit binary value 00101100. Tick ONE box to show the denary value of this number.
[ ] 38 [ ] 44 [ ] 52 [ ] 76 [1]
1 (b) A technician writes the 8-bit binary value 10111001 as a hexadecimal number. Tick ONE box to show the correct hexadecimal value.
[ ] 9B [ ] 93 [ ] B9 [ ] B3 [1]
1 (c) A text label uses 8-bit ASCII. The code for the character 'F' is 70. Tick ONE box to show the code for the character 'J'.
[ ] 72 [ ] 74 [ ] 76 [ ] 80 [1]
1 (d) The museum records an audio guide by sampling the sound. Tick TWO boxes to show the statements that are true.
[ ] Increasing the sample rate increases the file size. [ ] Reducing the bit depth increases the file size. [ ] Doubling the duration, with all other settings unchanged, halves the file size. [ ] A higher bit depth lets each sample be stored more precisely. [ ] The sample rate is the number of bits used for each sample. [2]
Show answer & marking schemeHide answer & marking scheme
Worked solution
(a) 00101100 = 32 + 8 + 4 = 44. (b) Split into nibbles: 1011 = B, 1001 = 9, giving B9. (c) J is 4 letters after F (G, H, I, J), so the code is 70 + 4 = 74, because character codes are in logical order. (d) File size = sample rate x duration x bit depth, so a higher sample rate makes the file larger. A higher bit depth gives more possible values per sample, so each sample is more precise. The other statements are false: lower bit depth reduces size, doubling duration doubles size, and sample rate is samples per second (Hz), not bits per sample.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1(a) | 44 | 1 | Only one box ticked. | | 1(b) | B9 | 1 | Only one box ticked. | | 1(c) | 74 | 1 | Only one box ticked. | | 1(d) | Increasing the sample rate increases the file size // A higher bit depth lets each sample be stored more precisely | 2 | 1 mark for each correct box ticked. max 2 marks: if more than two boxes are ticked, award 1 mark for each correct tick minus 1 for each incorrect tick, to a minimum of 0. | | | Total | 5 | |
Question 19 · Short response
1 marks
A weather station stores each temperature reading as an 8-bit binary number.
Convert the binary number 00101101 into denary. [1]
Show answer & marking schemeHide answer & marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1 | 45 | 1 | Do not accept 0101101 or any answer with a base subscript that contradicts denary. Ignore a base subscript such as 45(10). |
Question 20 · Short response
1 marks
A small office connects its computers in a star topology.
State one advantage of using a star topology rather than a mesh topology for this office. [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
In a star network each device connects only to a central switch, so far fewer cables are needed than in a mesh where devices are connected to several others. It is also easier to add a new device.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 2 | Any one from: cheaper (to install) // less cabling needed; easier to add a new device / to set up; easier to manage / to find a fault; a failed cable only affects one device | 1 | Allow simpler to install. Do not accept 'faster' or 'more secure' without justification. Do not accept 'cheap' with no comparison. max 1 |
Question 21 · Short response
1 marks
A program asks a user to enter their age. The age must be a whole number from 11 to 18 inclusive.
Give one example of boundary test data for this input. [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
Boundary data lies at the edge of the valid range. The edges are 11 and 18; values immediately outside (10 and 19) are also accepted as boundary tests.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 3 | Any one from: 11; 18; 10; 19 | 1 | Do not accept values such as 15 (normal data) or 'twelve' / 'abc' (erroneous data). max 1 |
Question 22 · Short response
1 marks
The following program is written in OCR Exam Reference Language.
``` total = 0 for i = 1 to 4 total = total + i next i print(total) ```
State the value that is output when the program is run. [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
The loop runs for i = 1, 2, 3, 4 (inclusive). total becomes 1, 3, 6, 10. Then 10 is printed.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 4 | 10 | 1 | Do not accept 1, 3, 6 or a list of values. |
Question 23 · Short response
2 marks
A weather station stores each reading as an 8-bit binary number.
Convert the binary number 01101001 into denary. Show your working. [2]
Show answer & marking schemeHide answer & marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1 | Identifies the correct place values / bits set (64, 32, 8, 1) (1) ; Answer 105 (1) | 2 | Allow 1 mark for correct working with an arithmetic slip. Answer 105 with no working gets 2. |
Question 24 · Short response
2 marks
A small library connects its computers in a star topology using a central switch.
Give two advantages of using a star topology rather than a mesh topology for the library. [2]
Show answer & marking schemeHide answer & marking scheme
Worked solution
A star needs only one cable per device to the switch, whereas a mesh needs many links between devices. Devices can be added without disturbing others, and one failed cable only disconnects one device.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 2 | Cheaper / less cabling / fewer connections needed (1) ; Easy to add or remove a device without disrupting the network (1) ; A cable failure affects only one device (1) ; Easier to set up / manage / locate faults (1) | max 2 | Do not accept 'faster' or 'more secure' without a reason. Ignore 'reliable' on its own. |
Question 25 · Short response
2 marks
The following program is written in OCR Exam Reference Language.
1 total = 0 2 for i = 1 to 4 3 total = total + i * 2 4 next i 5 print(total)
State the value that is output by the program. Show your working. [2]
Show answer & marking schemeHide answer & marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 3 | Evidence of loop running 4 times adding 2, 4, 6, 8 / correct running totals (1) ; 20 (1) | 2 | Output mark can be awarded for 20 without working. Allow 1 mark for 20 - 2*? slips only if working shows correct method; allow follow-through of the final total from a single arithmetic slip in working. |
Question 26 · Short response
2 marks
A school website asks students to enter their year group, which must be a whole number from 7 to 11 inclusive.
Give one example of boundary test data and one example of invalid test data for this input. State what is expected to happen for each. [2]
Show answer & marking schemeHide answer & marking scheme
Worked solution
Boundary data is at the edge of the valid range, e.g. 7 or 11, and is accepted. Invalid data is of the correct type but outside the range, e.g. 12, and is rejected.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 4 | Boundary: 7 / 11 with outcome accepted (1) ; Invalid: a whole number below 7 or above 11 (e.g. 3, 12) with outcome rejected / error message (1) | 2 | Each mark needs the data and the matching outcome. Allow 6 or 12 as the boundary only if described as just outside and rejected. Do not accept text such as 'abc' for invalid (this is erroneous). |
Question 27 · Short response
2 marks
A greenhouse controller stores the temperature reading as the 8-bit binary number shown below.
0 0 0 0 1 1 0 1
(a) Convert the binary number to denary. [1]
(b) The controller performs a binary shift two places to the left on the number. Write down the 8-bit result of the shift. [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
(a) 00001101: 8 + 4 + 1 = 13. (b) Shifting left by two places moves every bit two places left and fills the right with zeros: 00001101 becomes 00110100 (which is 52, i.e. 13 x 4).
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | (a) | 13 | 1 | Accept 13 only as the final denary value. | | (b) | 00110100 | 1 | Accept 110100 (leading zeros optional). Do not accept answers with the wrong number of shifted places. Allow follow-through only if the candidate's own part (a) is irrelevant: the shift is marked from the printed binary number. | | Total | | 2 | |
Ready to test yourself?
Turn these notes into exam-style practice. Get unlimited AI questions on this topic with instant marking and explanations.
Answer all five main questions. Allow approximately 50 minutes. General algorithm responses may use an appropriate representation unless the individual task specifies otherwise.
18 Question · 50 marks
Question 1 · Algorithm and program construction
6 marks
A depot uses a program to check ten parcels as they arrive.
Create an algorithm that: - asks the user to enter the weight of each of the ten parcels, in kilograms (kg) - rejects any weight that is less than 0.1 or greater than 30, and asks for the weight again until a valid weight is entered - counts the parcels that weigh more than 20 kg - calculates the total weight of the ten parcels - outputs the total weight and the number of parcels that weigh more than 20 kg after all ten weights have been accepted.
You do not need to check that the input is a number.
You may use OCR Exam Reference Language, a high-level programming language, pseudocode or a flowchart. [6]
Show answer & marking schemeHide answer & marking scheme
Worked solution
Initialise total and heavy to 0. Use a count-controlled loop for the ten parcels. Inside it, use a DO UNTIL loop to input the weight until it is between 0.1 and 30 inclusive. Add each accepted weight to total. If the weight is greater than 20, add 1 to heavy. After the loop, output total and heavy.
Example answer (OCR Exam Reference Language):
total = 0 heavy = 0 for i = 1 to 10 do weight = real(input("Enter weight in kg")) until weight >= 0.1 AND weight <= 30 total = total + weight if weight > 20 then heavy = heavy + 1 endif next i print("Total weight: " + str(total)) print("Heavy parcels: " + str(heavy))
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | Construction | 1. Count-controlled loop (or equivalent) that repeats the weight entry ten times. | 1 | Allow a WHILE loop with a counter that is initialised and incremented. Do not accept a loop that runs 9 or 11 times. | | | 2. Input of a weight inside the loop, stored in a variable. | 1 | Allow casting or no casting. | | | 3. Validation loop that repeats the input while the weight is invalid. | 1 | Allow a WHILE loop with an initial input before it, or a DO UNTIL loop. Must re-ask for the weight rather than skip it. | | | 4. Correct condition: rejects below 0.1 and above 30, and accepts 0.1 and 30. | 1 | Allow equivalent forms, for example weight < 0.1 OR weight > 30. Do not accept AND in the reject condition. Do not accept a condition that rejects 0.1 or 30. | | | 5. Total initialised to 0 before the loop and each accepted weight added to it. | 1 | Both parts are needed. The weight must be added once per accepted parcel, not for rejected inputs. | | | 6. Heavy-parcel counter initialised to 0, incremented when weight > 20, and both total and count output after the loop. | 1 | Condition must be strictly greater than 20. Outputs must be outside the loop. Allow output of the values without text. Allow only one output if the other has been awarded elsewhere. Do not award if the counter is not initialised. |
Max 6 marks. Allow appropriate equivalent syntax in a high-level language, pseudocode or a flowchart, provided the logic is clear. Minor syntax errors are not penalised. Ignore the names chosen for variables.
Question 2 · Algorithm execution
4 marks
A weather station records the number of millimetres of rainfall on five days. The readings are stored in this list:
The readings are sorted into ascending order using a bubble sort. Each pass starts at position 0 and compares neighbouring items in turn, swapping them if they are in the wrong order. The algorithm stops after a complete pass in which no swaps are made.
(a) Complete the table to show the contents of the list at the end of each of the first three passes. [3]
(b) State the total number of passes needed, including the final pass in which no swaps are made. [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
Start: 7 3 9 2 5. Pass 1: swap 7,3 -> 3 7 9 2 5; 7,9 no swap; swap 9,2 -> 3 7 2 9 5; swap 9,5 -> 3 7 2 5 9. Pass 2: 3,7 no swap; swap 7,2 -> 3 2 7 5 9; swap 7,5 -> 3 2 5 7 9; 7,9 no swap. Pass 3: swap 3,2 -> 2 3 5 7 9; no other swaps. The list is now sorted, but a swap was made in this pass so the algorithm cannot yet stop. Pass 4: no swaps are made, so the algorithm stops. Total passes = 4.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | (a) | Pass 1 row: 3, 7, 2, 5, 9 | 1 | All five values must be correct and in the correct positions. | | (a) | Pass 2 row: 3, 2, 5, 7, 9 | 1 | Allow follow-through from an incorrect Pass 1 row only if the pass has been applied correctly to that row. | | (a) | Pass 3 row: 2, 3, 5, 7, 9 | 1 | Allow follow-through from an incorrect Pass 2 row only if the pass has been applied correctly to that row. | | (b) | 4 (passes) | 1 | Do not accept 3. Allow follow-through only if the candidate's Pass 3 row is still unsorted (answer 1 more than the number of passes needed to reach a sorted list in their working). |
Total: 4 marks
Question 3 · Algorithm tracing
2 marks
A programmer writes an algorithm to keep a running score for a quiz game.
``` 01 score = 0 02 for i = 1 to 5 03 if i MOD 2 == 0 then 04 score = score + i 05 else 06 score = score - 1 07 endif 08 next i 09 print(score) ```
Complete the trace table to show the algorithm being run. Write the value of score after each pass of the loop. The first row has been completed for you. Then state the value that is printed.
Show answer & marking schemeHide answer & marking scheme
Worked solution
Start with score = 0. i = 1: odd, so score = 0 - 1 = -1 (given). i = 2: even, so score = -1 + 2 = 1. i = 3: odd, so score = 1 - 1 = 0. i = 4: even, so score = 0 + 4 = 4. i = 5: odd, so score = 4 - 1 = 3. The loop ends and print(score) outputs 3.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1 | Trace table rows i=2 to i=5 show score as 1, 0, 4, 3 | 1 | Award 1 mark for at least three of the four values correct (1, 0, 4, 3). Allow follow-through of a wrong value into later rows if the rule is applied correctly. | | 1 | Printed value is 3 | 1 | Award only if the last row of the table is 3, or if the printed value follows through from the candidate's last row. Do not accept more than one printed value. Ignore a table that is incomplete if the final output is 3. |
Total: 2 marks. Max 1 if the table is fully correct but no printed value is given, or the printed value is given with an incorrect table that does not follow through.
Question 4 · Code completion and refinement
3 marks
A weather station records the rainfall, in whole millimetres, on each of 7 days. The program below should:
- ask the user to enter the rainfall for each of the 7 days - count the number of days on which the rainfall was more than 10 mm - output the total rainfall and the number of wet days.
The program has three gaps, labelled A, B and C.
``` 01 total = 0 02 wetDays = 0 03 for i = 1 to ....A.... 04 rain = int(input("Enter the rainfall in mm")) 05 total = total + rain 06 if rain ....B.... 10 then 07 wetDays = ....C.... 08 endif 09 next i 10 print("Total rainfall: " + str(total)) 11 print("Wet days: " + str(wetDays)) ```
Complete the program by writing the missing code for A, B and C.
A ..............................
B ..............................
C .............................. [3]
Show answer & marking schemeHide answer & marking scheme
Worked solution
The loop must run once for each of the 7 days, so the upper bound is 7 (the bounds of a FOR loop are inclusive, and it starts at 1). A day is wet only if the rainfall is MORE than 10 mm, so the comparison operator is >. Each wet day adds 1 to the counter, so wetDays is assigned wetDays + 1.
A: 7 B: > C: wetDays + 1
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | A | 7 | 1 | Do not accept 6 or 8. | | B | > | 1 | Do not accept >=. Do not accept the word 'greater than' written without the symbol. | | C | wetDays + 1 | 1 | Accept 1 + wetDays. Allow wetDays = wetDays + 1 if the whole statement is rewritten. Do not accept wetDays + i. |
Total: 3 marks. Each gap is marked independently. Ignore minor differences in spacing.
Question 5 · Code completion and refinement
5 marks
A leisure centre records how many visitors use its pool on each day of one week. The program below should:
- read the number of visitors for each of the 7 days - reject any value that is below 0 or above 500 and ask for it again - store each valid value in an array - output the total number of visitors and the highest daily number
``` 01 array visitors[7] 02 total = 0 03 highest = 0 04 for day = 0 to ......A...... 05 count = int(input("Enter visitors")) 06 while count < 0 ......B...... count > 500 07 count = int(input("Invalid. Enter again")) 08 endwhile 09 visitors[day] = count 10 total = ......C...... + count 11 if count > highest then 12 highest = count 13 endif 14 next day 15 print(total) 16 print(highest) ```
(a) Complete the three gaps A, B and C so that the program works as described.
(b) The manager also wants the program to output the number of days on which more than 300 visitors were recorded.
Refine the program to do this. You may write your answer in OCR Exam Reference Language or a high-level programming language. State the line number after which each new statement should be placed. [2]
Show answer & marking schemeHide answer & marking scheme
Worked solution
(a) The array has 7 elements, so the loop must run for day = 0 to 6 (A = 6). A value is invalid if it is below 0 OR above 500; AND could never be true for both at once (B = OR). The running total adds the new count to the existing total (C = total).
(b) A counter is needed. Initialise it before the loop and add 1 whenever count is greater than 300, inside the loop. Output it after the loop has finished.
Example: After line 03: busyDays = 0 After line 13 (inside the loop, before next day): if count > 300 then busyDays = busyDays + 1 endif After line 16: print(busyDays)
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1(a) | A = 6 | 1 | Accept 7 - 1. Do not accept 7. | | 1(a) | B = OR | 1 | Accept || if a high-level language is used. Do not accept AND. | | 1(a) | C = total | 1 | Do not accept count or highest. | | 1(b) | Counter initialised to 0 before the loop AND output after the loop (after line 14 / 15 / 16, outside the loop) | 1 | Both parts are needed for the mark. Accept any valid identifier. Accept the output placed before or after existing print statements provided it is outside the loop. | | 1(b) | Selection with condition count > 300 inside the loop AND counter incremented by 1 inside that selection | 1 | Placed within lines 05-13 after count has been validated. Accept visitors[day] > 300 as the condition. Accept busyDays += 1 or equivalent. Do not accept >= 300. |
Total: 5 marks. Benefit of doubt: minor syntax slips (for example a missing endif) are ignored in 1(b) provided the structure is clear. Follow-through: if the counter variable is named differently in the initialisation and the output, award the mark for the part that is consistent.
Question 6 · Developed response
4 marks
A museum records a spoken audio guide for visitors. The recording is stored as an uncompressed digital sound file with these properties:
(a) Calculate the size of the sound file in bytes. Show your working. [2]
(b) The museum re-records the guide using a sample rate of 4 000 Hz. All other properties stay the same. Describe the effect of this change on the file size and on the sound quality. [2]
Show answer & marking schemeHide answer & marking scheme
Worked solution
(a) File size in bits = sample rate x duration x bit depth = 8 000 x 10 x 16 = 1 280 000 bits. Divide by 8 to convert to bytes: 1 280 000 / 8 = 160 000 bytes. (b) Halving the sample rate halves the number of samples stored, so the file size is halved (80 000 bytes). Fewer samples means the digital wave is a less accurate copy of the original analogue sound, so quality is reduced.
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | 1(a) | Multiplies 8 000 x 10 x 16 (to get 1 280 000 bits) | 1 | Allow correct method shown even if arithmetic is wrong. | | 1(a) | Divides by 8 to give 160 000 bytes | 1 | Accept 160 KB // 156.25 KB (if 1 024 used). Correct answer with no working: 2 marks. Follow-through allowed from an arithmetic slip in the first mark for the division mark only. | | 1(b) | File size is halved // smaller | 1 | Do not accept 'smaller' with no indication of why if contradicted. Accept 80 000 bytes. | | 1(b) | Quality is lower // less accurate representation of the original sound because fewer samples per second | 1 | Allow 'less detail'/'less clear'. Ignore 'distorted' alone. |
Question 7 · Developed response
4 marks
A school library uses a terminal where students enter a 4-character locker code.
Write an algorithm that: - asks the user to enter a locker code - repeats the request, with an error message, while the code entered is not exactly 4 characters long - outputs "Code accepted" once a valid code has been entered.
You must write your answer using either OCR Exam Reference Language or a high-level programming language. [4]
Show answer & marking schemeHide answer & marking scheme
Worked solution
The code is input once, then a condition-controlled WHILE loop checks the length. While invalid, an error message is output and the code is requested again. When the loop ends the code must be valid, so "Code accepted" is output.
code = input("Enter locker code") while code.length != 4 print("Code must be 4 characters") code = input("Enter locker code") endwhile print("Code accepted")
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | 2 | Input of the code stored in a variable (before and within the loop) | 1 | Allow input prompt omitted. | | 2 | Suitable condition-controlled loop (while/do until) | 1 | Condition must be correct for the chosen loop type, e.g. DO UNTIL with length == 4. | | 2 | Correct length check of exactly 4 characters (length != 4 // == 4) | 1 | Do not accept < 4 or > 4 alone. Accept len(code) in Python. | | 2 | Error message output inside the loop AND "Code accepted" output after the loop, with the code re-requested inside the loop | 1 | Both outputs needed with re-input inside the loop. Minor syntax errors not penalised. Natural English, bullet points or pseudocode: 0 marks. |
Question 8 · Logic and diagram
2 marks
A greenhouse has an automatic sprinkler. The sprinkler output, S, is controlled by two sensors.
- D is 1 when the soil is dry, otherwise 0. - R is 1 when rain is detected, otherwise 0.
The sprinkler is switched on (S = 1) only when the soil is dry and rain is NOT detected. This is shown by the logic diagram below:
D ----------------\ AND ---- S R ---- NOT -------/
Complete the truth table for this logic diagram by writing the value of S in each row.
Show answer & marking schemeHide answer & marking scheme
Worked solution
The NOT gate inverts R. S = D AND (NOT R). Row 1: D=0, NOT R=1, so S=0. Row 2: D=0, NOT R=0, so S=0. Row 3: D=1, NOT R=1, so S=1. Row 4: D=1, NOT R=0, so S=0.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1 | S column: 0, 0, 1, 0 (top to bottom) | 2 | All four values correct = 2 marks. Any three correct = 1 mark. Two or fewer correct = 0 marks. Accept T/F or True/False for 1/0. Do not accept ticks or crosses or other symbols. |
Question 9 · Logic and diagram
3 marks
A greenhouse has a ventilation fan controlled by a logic circuit. The circuit has three inputs:
- T = 1 when the temperature is too high - W = 1 when the roof window is open - M = 1 when the manual override switch is pressed
The circuit is built from three gates:
- A NOT gate takes input W. - An AND gate takes input T and the output of the NOT gate. Its output is P. - An OR gate takes P and input M. Its output is S, which turns the fan on when S = 1.
Complete the truth table for this circuit. Fill in the columns P and S for all eight rows.
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1 | P column correct for all eight rows (0,0,0,0,1,1,0,0) | 1 | All eight must be correct. | | 1 | S column: 2 marks for all eight rows correct (0,1,0,1,1,1,0,1); 1 mark for six or seven rows correct | 2 | Follow-through: S may be marked from the candidate's own P column, as S = P OR M. Accept T/F for 1/0. Do not accept blank cells as correct. |
Question 10 · Matching
3 marks
A community library uses a network to run its services.
Draw one line from each network task to the protocol that is most suitable for it. Draw only three lines. Not every protocol is needed.
Network task: T1: A librarian uploads a large catalogue file to the library's file server. T2: A visitor opens the library's website and enters card details, and the data must be encrypted. T3: A member's email program sends a reminder email to the mail server.
Show answer & marking schemeHide answer & marking scheme
Worked solution
T1 is a file transfer, so FTP. T2 needs a secure web connection, so HTTPS. T3 is sending email to a server, so SMTP. POP and IMAP are used to retrieve email, not to send it.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1 | T1 matched to FTP | 1 | Only one line from each task. | | 1 | T2 matched to HTTPS | 1 | | | 1 | T3 matched to SMTP | 1 | |
Guidance: If a task has more than one line drawn, do not award the mark for that task. Max 3 marks.
Question 11 · Selected response
3 marks
A student records a podcast and stores it as a digital sound file.
The statements below are about how sound is stored in a computer.
Tick (✓) three boxes to show the statements that are true.
| Tick | Statement | |---|---| | [ ] A | Increasing the sample rate increases the size of the sound file. | | [ ] B | Sample rate is measured in bits. | | [ ] C | Bit depth is the number of bits used to store each sample. | | [ ] D | Doubling the duration of a recording halves the file size. | | [ ] E | A higher bit depth allows each sample to be stored more accurately. | | [ ] F | Analogue sound waves can be stored directly in memory without being converted. |
[3]
Show answer & marking schemeHide answer & marking scheme
Worked solution
Sound file size = sample rate × duration × bit depth, so a higher sample rate gives a larger file (A is true). Sample rate is measured in Hertz, not bits (B false). Bit depth is the number of bits per sample (C true). Doubling the duration doubles the file size (D false). More bits per sample gives more possible values, so each sample is stored more accurately (E true). Analogue sound must be sampled and converted to binary before storage (F false). The three true statements are A, C and E.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1 | A - increasing the sample rate increases the file size | 1 | One mark for each correct box ticked (AO1). | | 1 | C - bit depth is the number of bits used to store each sample | 1 | | | 1 | E - a higher bit depth allows each sample to be stored more accurately | 1 | |
Guidance: Maximum 3 marks. If more than three boxes are ticked, award one mark for each correct tick but deduct one mark for each incorrect tick beyond three (the total cannot be below 0). Do not award a mark for B, D or F.
Question 12 · Selected response
4 marks
A student is revising how computers store numbers and characters.
The statements below are about binary, hexadecimal and character sets.
Tick (✓) the FOUR statements that are true.
| Tick | Statement | |------|-----------| | [ ] A | The 8-bit binary number 00101101 is 2D in hexadecimal. | | [ ] B | The hexadecimal number FF is 256 in denary. | | [ ] C | Shifting a binary number right by one place doubles its value. | | [ ] D | The denary number 200 is 11001000 in 8-bit binary. | | [ ] E | The 8-bit binary number 10000000 has the denary value 64. | | [ ] F | Adding 11000000 and 01000000 as 8-bit binary integers causes an overflow error. | | [ ] G | Unicode uses fewer bits per character than 8-bit ASCII. | | [ ] H | Shifting a binary number left by two places multiplies its value by 4, provided no 1s are shifted out of the register. |
[4]
Show answer & marking schemeHide answer & marking scheme
Worked solution
A: 0010 = 2 and 1101 = D, so 2D. True. B: FF = 15 x 16 + 15 = 255, not 256. False. C: Shifting right halves the value. False. D: 128 + 64 + 8 = 200, which is 11001000. True. E: 10000000 = 128, not 64. False. F: 192 + 64 = 256, which needs 9 bits, so the result does not fit in 8 bits: overflow. True. G: Unicode uses more bits per character than 8-bit ASCII so it can represent more characters. False. H: Each left shift multiplies by 2, so two shifts multiply by 4. True.
Correct statements: A, D, F, H.
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | 1 | A ticked | 1 | | | 1 | D ticked | 1 | | | 1 | F ticked | 1 | | | 1 | H ticked | 1 | max 4 |
Guidance: Award one mark for each correct statement ticked. If more than four boxes are ticked, deduct one mark for each tick beyond four (minimum 0). Do not accept ticks for B, C, E or G.
Question 13 · Short response
1 marks
A weather sensor stores a reading as the 8-bit binary number 00101101.
Convert this binary number into denary. [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
Place values: 128 64 32 16 8 4 2 1. The bits set to 1 are 32, 8, 4 and 1. 32 + 8 + 4 + 1 = 45.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1 | 45 | 1 | Accept 0045 / 45 with working. Do not accept an answer given in binary. |
Question 14 · Short response
1 marks
A small office has a wired star network. All of the computers are connected to a central switch.
State the purpose of the switch in this network. [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
A switch is the central connection point of a star network. It reads the destination address of incoming data and sends it only to the device it is intended for.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 2 | Sends/forwards data (packets) to the correct/intended device // connects the devices (on the LAN) together and directs data between them | 1 | Allow 'central point/hub that the devices connect to' only if linked to passing data between devices. Do not accept 'connects the network to the Internet' (router). Do not accept 'broadcasts data to every device'. |
Question 15 · Short response
1 marks
A school library system asks users to enter a username and a password before they can borrow books.
State what is meant by authentication. [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
Authentication is a defensive design technique that checks the identity of a user, for example by checking a username and password, before access is allowed.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 3 | Checking/confirming/verifying the identity of a user // checking that the user is who they say they are | 1 | Allow 'checking login details are correct'. Do not accept 'checking that data entered is sensible' (validation). Do not accept 'stopping hackers' without reference to identity. |
Question 16 · Short response
1 marks
A program contains the following line of code written in OCR Exam Reference Language.
``` print(23 MOD 6) ```
State the value that is output when this line is run. [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
MOD gives the remainder after division. 23 divided by 6 is 3 remainder 5 (6 x 3 = 18; 23 - 18 = 5). The output is 5.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 4 | 5 | 1 | Do not accept 3 (the DIV result) or 3.83. |
Question 17 · Short response
1 marks
A program for a school library records whether each book is currently on loan. The program stores this as a variable called onLoan, which can only be True or False.
State the most suitable data type for the variable onLoan. [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
The variable can hold only two values, True or False. The data type designed for exactly two values is Boolean.
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1 | Boolean | 1 | Accept bool. Allow minor spelling errors where the intended word is clear, e.g. Boolian. Do not accept string, integer, character or real. |
Question 18 · Short response
2 marks
A weather station stores the highest wind speed of the day as the 8-bit binary number shown below.
0 1 1 0 1 0 1 1
Convert this binary number to hexadecimal. Show your working.
Hexadecimal: ................... [2]
Show answer & marking schemeHide answer & marking scheme
Worked solution
Split the 8-bit number into two nibbles: 0110 and 1011. 0110 = 4 + 2 = 6. 1011 = 8 + 2 + 1 = 11, which is B in hexadecimal. Join the two digits: 6B.
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | 1 | Left nibble 0110 converted to 6 (1 mark) | 1 | Accept 6 shown as the first digit of the answer. Accept working showing the split 0110 / 1011 only if the digit 6 is also given. | | 1 | Right nibble 1011 converted to B (1 mark) | 1 | Accept b. Do not accept 11 as the final digit. Allow the mark if the digits are given in the wrong order, e.g. B6, provided each nibble was converted correctly (max 1 in that case). | | 1 | Total | 2 | Award 2 marks for the correct answer 6B with no working. Allow 0x6B or 6B16. Ignore leading or trailing spaces. |
J277/02 — Section B
Answer all parts of one main applied question. Allow approximately 40 minutes. Use OCR Exam Reference Language or a studied high-level language where explicitly required; the general design item permits an appropriate algorithm representation.
11 Question · 30 marks
Question 1 · Algorithm and program construction
2 marks
A school gym uses a keypad to open its lockers. A locker code must contain exactly 4 characters.
Write a program, using the OCR Exam Reference Language or a high-level programming language, that: - asks the user to enter a locker code - repeats the input until a code of exactly 4 characters is entered - outputs "Locker open" once a valid code has been entered.
You do not need to check that the characters are digits. [2]
Show answer & marking schemeHide answer & marking scheme
Worked solution
The code must be read at least once and re-read while its length is not 4. A WHILE loop with a first input before it (or a DO UNTIL loop) does this. When the loop ends, the code is valid, so the message is printed once.
Alternative using DO UNTIL: do code = input("Enter locker code") until code.length == 4 print("Locker open")
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | 1 | Input of the code stored in a variable, and a condition-controlled loop that repeats the input while the length is not 4 (until the length is 4) | 1 | Allow any suitable loop that repeats the input, including DO UNTIL or WHILE with a first input before the loop. Allow len(code) or equivalent length syntax. Do not accept a loop that does not re-input inside it. Do not accept IF used instead of a loop. | | 1 | Correct length comparison (!= 4 for while, == 4 for until) and "Locker open" output once, after the loop | 1 | Do not award if the print is inside the loop. Output text must match, ignore case and quote style. Minor syntax errors are not penalised. Answers in pseudocode, natural English or bullet points earn no marks. Max 2. |
Question 2 · Algorithm and program construction
3 marks
A greenhouse has a sensor that records the temperature in degrees Celsius once an hour. A gardener wants a program to check six hourly readings.
Write a program, using OCR Exam Reference Language or a high-level programming language, that:
- allows the user to enter six temperature readings, one at a time - counts how many of the readings are greater than 30 - outputs the count after all six readings have been entered.
You do not need to validate the readings.
[3]
Show answer & marking schemeHide answer & marking scheme
Worked solution
Set a counter to 0 before the loop. Use a count-controlled loop that runs exactly six times, taking an input each time. Inside the loop, use selection to test whether the reading is greater than 30 and, if so, add 1 to the counter. After the loop has finished, output the counter.
OCR Exam Reference Language: count = 0 for i = 0 to 5 reading = float(input("Enter temperature")) if reading > 30 then count = count + 1 endif next i print(count)
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | 1 | Initialises a counter variable to 0 before the loop and increments it by 1 inside the loop (when the condition is met) | 1 | Allow any valid identifier. Allow count += 1 or equivalent. Do not accept the counter being reset to 0 inside the loop. | | 1 | Loop that repeats six times (and an input is taken on each iteration) | 1 | Allow for i = 1 to 6 // while loop with a correct counter // six separate input statements (max 1 for this point). Do not accept a loop that runs 5 or 7 times. Ignore whether the input is cast to int/float. | | 1 | Selection that compares the reading with 30 using > (or equivalent) AND outputs the count after the loop | 1 | Both parts are needed for the mark. Allow reading >= 31 for integer input. Do not accept the output inside the loop if it is printed at every iteration. Ignore minor syntax errors, for example a missing endif or next. Answers in pseudocode, natural English or bullet points earn no marks. |
Question 3 · Algorithm and program construction
4 marks
1 A school greenhouse has a sensor that records the temperature in degrees Celsius once each day. A teacher wants a program that checks one week of readings.
Write a program, using the OCR Exam Reference Language or a high-level programming language, that:
- asks the user to enter the temperature for each of the 7 days - counts how many of the temperatures entered are greater than 30 - outputs the message `Hot days: ` followed by the count when all 7 temperatures have been entered.
You do not need to check that the temperatures entered are valid.
[4]
Show answer & marking schemeHide answer & marking scheme
Worked solution
A counter (hotDays) is set to 0 before the loop. A count-controlled FOR loop runs exactly 7 times; on each pass a temperature is input and cast to a number. An IF statement tests whether it is greater than 30 and, if so, adds 1 to the counter. After the loop ends, the message and the count are output once.
OCR Exam Reference Language:
hotDays = 0 for i = 1 to 7 temp = real(input("Enter temperature")) if temp > 30 then hotDays = hotDays + 1 endif next i print("Hot days: " + str(hotDays))
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | 1 | Counter variable initialised to 0 before the loop // before it is incremented | 1 | Allow any suitable identifier. Do not award if initialised inside the loop. | | | Count-controlled loop that repeats exactly 7 times (with an input inside the loop) | 1 | Allow for i = 0 to 6 // for i = 1 to 7 // equivalent while/do until loop with its own counter, correctly controlled. Do not award if the input is outside the loop. | | | Selection that compares the temperature with 30 using > (and increments the counter by 1 when true) | 1 | Allow temp >= 31 for integer-only input. Do not accept >= 30 or temp > 30 compared to the wrong variable. Allow the increment to be shown as count = count + 1 // count += 1. | | | Outputs the message and the final count once, after the loop | 1 | Allow + or comma for joining text and the count. Ignore missing str() / casting. Do not award if the output is inside the loop. |
Overall guidance: answers must be in OCR Exam Reference Language or a high-level language; pseudocode, natural English or bullet points earn no marks. Minor syntax errors are not penalised (e.g. missing next i, endif, or casting). Allow equivalent language syntax provided the constructs are valid. Max 3 if the count is not made by comparing each temperature with 30 (e.g. totals the temperatures instead).
Question 4 · Algorithm and program construction
6 marks
1 A village weather club records the rainfall, in millimetres, on each of the 7 days of a week. Each reading is a real number.
Write a program, in OCR Exam Reference Language or a high-level programming language of your choice, that:
- asks the user to enter the 7 daily readings, one at a time - rejects any reading that is less than 0 and asks for that reading again until a valid value is entered - stores the valid readings in an array - outputs the total rainfall for the week - outputs the highest daily reading - outputs the number of days on which the reading was exactly 0.
You do not need to check that the input is a number. Do not use any built-in sum, maximum or count functions. [6]
Show answer & marking schemeHide answer & marking scheme
Worked solution
Declare an array of 7 elements and initialise total, highest and a dry-day counter to 0. Use a count-controlled loop from 0 to 6. Inside it, input a reading, then use a condition-controlled loop to repeat the input while the reading is below 0. Store the valid reading in the array, add it to the total, update highest if it is larger, and add 1 to the counter if it equals 0. After the loop, output the three results.
Example (OCR Exam Reference Language):
array rain[7] total = 0 highest = 0 dryDays = 0 for i = 0 to 6 reading = float(input("Enter rainfall for day " + str(i + 1))) while reading < 0 reading = float(input("Invalid. Enter rainfall again")) endwhile rain[i] = reading total = total + reading if reading > highest then highest = reading endif if reading == 0 then dryDays = dryDays + 1 endif next i print(total) print(highest) print(dryDays)
Starting highest at 0 is safe because all valid readings are 0 or more.
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | 1 | Creates an array of size 7 (or equivalent) AND initialises the total and the dry-day counter to 0 before the loop | 1 | Allow the array to be created or filled using any valid syntax. Allow highest being initialised here or set to the first reading. | | | Count-controlled loop that repeats exactly 7 times (e.g. for i = 0 to 6) | 1 | Allow 1 to 7 if the array indexing is consistent. Allow a while loop with a counter. | | | Inputs a reading (as a real/float) inside the loop | 1 | Ignore missing casting if the language does not need it. Do not accept the prompt only without input. | | | Validation: repeats the input while / until the reading is < 0 (correct condition and a re-prompt) | 1 | Allow reading <= -0.1 or equivalent. Do not accept an if with no repetition. Do not accept validation that rejects 0. | | | Valid reading stored in the array at the correct index AND added to a running total | 1 | Both are needed for the mark. Allow the total to be calculated by a separate loop over the array. | | | Correct comparison to find the highest reading (reading > highest with assignment) AND correct counting of readings equal to 0 AND all three results output after the loop | 1 | All three elements are needed. Allow follow through for highest if initialised to a value other than 0 that is valid. Do not accept outputs inside the loop. max 5 if any element is missing. |
General: minor syntax errors are not penalised (e.g. missing endwhile, = instead of == in the comparison). Answers written in pseudocode, natural English or bullet points score 0. Allow equivalent syntax in a high-level language, but identifiers must be consistent and constructs valid. Ignore capitalisation of keywords.
Question 5 · Algorithm tracing
4 marks
A school gym records the number of minutes each member spends on a rowing machine in a session. The algorithm below adds the minutes together, but stops as soon as the running total reaches the session limit. Adjustments are made for long sessions.
``` 01 array minutes = [5, 12, 8, 3, 10] 02 limit = 20 03 total = 0 04 i = 0 05 while i < 5 AND total < limit 06 total = total + minutes[i] 07 if minutes[i] > 7 then 08 total = total - 2 09 endif 10 i = i + 1 11 endwhile 12 print(total) 13 print(i) ```
Complete the trace table for this algorithm. Record the values of i and total at the end of each iteration of the loop, and write each value that is output in the Output column. Not every row may be needed.
Show answer & marking schemeHide answer & marking scheme
Worked solution
Initially i = 0 and total = 0. Iteration 1: total = 0 + 5 = 5; 5 is not > 7, so no subtraction; i = 1. Check: 1 < 5 and 5 < 20, so continue. Iteration 2: total = 5 + 12 = 17; 12 > 7 so total = 17 - 2 = 15; i = 2. Check: 2 < 5 and 15 < 20, so continue. Iteration 3: total = 15 + 8 = 23; 8 > 7 so total = 23 - 2 = 21; i = 3. Check: 21 < 20 is false, so the loop ends. Output: 21 then 3.
| Question | Answer points | Marks | Guidance | |---|---|---|---| | 1 | Initial values i = 0 and total = 0 shown | 1 | Allow if shown as the first row or implied by the first iteration row being correct. | | 1 | First iteration row: i = 1, total = 5 | 1 | Do not accept if total is shown as 3 or any value other than 5. | | 1 | Second and third iteration rows: i = 2, total = 15 and i = 3, total = 21 (no further iterations) | 1 | Allow intermediate values 17 and 23 if shown in addition to the final values for the iteration, provided the end-of-iteration values are correct. Do not accept extra iterations. Award for a consistent second row of i = 2 and total = 15 and third row of i = 3 and total = 21 only. | | 1 | Outputs 21 then 3 in the correct order | 1 | Do not accept 3 before 21. Allow follow-through for the output marks from the candidate's own final total and i values only if the trace is otherwise consistent with the code (max 1 mark follow-through). |
Total: 4 marks. No blanket error carried forward; only the output mark may follow through as stated.
Question 6 · Code completion and refinement
1 marks
A swimming club records the number of lengths swum by each of five members. The program below reads the five values and should output the total number of lengths.
01 total = 0 02 for i = 0 to 4 03 lengths = int(input("Enter lengths swum")) 04 total = ____________________ 05 next i 06 print(total)
Complete line 04 so that each value entered is added to the running total. Write your answer in OCR Exam Reference Language or a high-level programming language. [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
The loop runs five times (i = 0 to 4). Each time, the value just entered (lengths) must be added to the existing value of total, then stored back in total. Line 04 is therefore: total = total + lengths
Marking scheme
Question 1 | Answer: total = total + lengths | Marks: 1 | Guidance: Accept total += lengths. Accept lengths + total. Allow equivalent syntax in a studied high-level language. Do not accept answers that omit total from the right-hand side (e.g. total = lengths) or that add a different variable (e.g. i). Ignore minor syntax errors such as capitalisation of the variable names if consistent.
Question 7 · Code completion and refinement
2 marks
A bakery uses a program to work out the cost of an order of loaves. Each loaf costs 2 pounds. An order of 10 or more loaves receives a 20% discount on the total cost.
The program is partly written in OCR Exam Reference Language:
01 loaves = int(input("Enter number of loaves")) 02 cost = loaves * 2 03 if ____________________ then 04 cost = ____________________ 05 endif 06 print(cost)
Complete the program by writing the missing code for line 03 and line 04. [2]
Line 03: if ____________________ then Line 04: cost = ____________________
Show answer & marking schemeHide answer & marking scheme
Worked solution
Line 03 must test whether the order is 10 or more loaves, so the condition is loaves >= 10 (loaves > 9 is also correct for whole numbers). Line 04 applies a 20% discount, which leaves 80% of the cost, so cost = cost * 0.8 (or cost - cost * 0.2).
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | Line 03 | loaves >= 10 // loaves > 9 | 1 | Accept 10 <= loaves. Do not accept loaves > 10 or loaves = 10 (or a single = sign). Ignore capitalisation of the variable only if it is used consistently. | | Line 04 | cost * 0.8 // cost - (cost * 0.2) // cost - cost / 5 // cost * 80 / 100 | 1 | Accept cost * (1 - 0.2). Do not accept cost * 0.2 or cost - 0.2. Minor syntax slips are not penalised. |
Total: 2 marks. The two marks are independent; no follow-through is needed.
Question 8 · Code completion and refinement
4 marks
A theme park kiosk sells ride tickets at a fixed price. The program below asks the user for the number of tickets (1 to 10), repeats the question until a valid number is entered, and then displays the total cost. Customers who buy 5 or more tickets receive a discount of 2.
``` const price = 2.50 01 tickets = ________(input("How many tickets (1-10)?")) 02 while tickets < 1 OR tickets > 10 03 print("Please enter 1 to 10") 04 tickets = int(input("How many tickets (1-10)?")) 05 endwhile 06 total = tickets * price 07 if tickets >= 5 then 08 total = total - 2 09 endif 10 print("Total: " + ________(total)) ```
(a) Complete lines 01 and 10 by writing the missing word in each space. [2]
Line 01: ______________________
Line 10: ______________________
(b) Lines 01 to 05 ask for the number of tickets in two separate places.
Refine lines 01 to 05 so that the question is asked in only one place. Your answer must use a DO UNTIL loop and must be written in OCR Exam Reference Language or a high-level programming language. [2]
Show answer & marking schemeHide answer & marking scheme
Worked solution
(a) input() returns a string, so it must be cast to an integer before it is compared with numbers: line 01 uses int. In line 10 the number total must be cast to a string so it can be joined to the text with +: line 10 uses str.
(b) A DO UNTIL loop always runs once, so the input can be placed inside it once and the separate first input is not needed. The loop must stop when the value is valid, so the condition is the opposite of the invalid test.
do tickets = int(input("How many tickets (1-10)?")) until tickets >= 1 AND tickets <= 10
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | (a) | Line 01: int | 1 | Accept integer. Allow real/float only if not penalised elsewhere: do not accept float for this mark. Do not accept str. | | (a) | Line 10: str | 1 | Accept string. Do not accept int. | | (b) | Uses do ... until structure with the input statement (cast to int) inside the loop, and no separate input before the loop | 1 | Minor syntax errors are not penalised. Allow equivalent syntax in a high-level language, e.g. do { ... } while (...) with the correct condition. Ignore whether the error message print is included. Do not accept a while loop. | | (b) | Correct stopping condition: tickets >= 1 AND tickets <= 10 // NOT (tickets < 1 OR tickets > 10) | 1 | Accept 1 <= tickets <= 10 in a high-level language that allows it. Do not accept OR in place of AND for the 'until' form. Do not accept a condition that repeats while the value is valid. A condition that matches the loop type used may be credited (e.g. while-form continuing condition tickets < 1 OR tickets > 10 in a high-level do-while). |
Total: 4 marks
Question 9 · Selected response
1 marks
A cinema booking program asks the user to enter the number of seats to reserve. The program must accept whole numbers from 1 to 6 inclusive and reject all other input.
A tester is choosing test data for this program.
Which one of the following is an example of boundary test data that the program should accept?
Tick (✓) one box.
A 3 [ ] B 6 [ ] C 10 [ ] D "six" [ ]
Show answer & marking schemeHide answer & marking scheme
Worked solution
Boundary data is of the correct data type and lies at the edge of the valid range. The valid range is 1 to 6, so 6 is a boundary value that is accepted. 3 is normal data, 10 is invalid data (rejected) and "six" is erroneous data (wrong data type, rejected).
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1 | B (6) | 1 | Only one box ticked. Do not award the mark if more than one box is ticked. |
Question 10 · Short response
1 marks
A programmer is writing a program for a school canteen. The program stores the total cost of a student's lunch in a variable called lunchCost. The cost is entered in pounds and pence, for example 3.45.
1 (a) State the most suitable data type for the variable lunchCost. [1]
Show answer & marking schemeHide answer & marking scheme
Worked solution
The cost contains pounds and pence, so it includes a decimal point and fractional part. A whole-number type cannot store 3.45, so the suitable type is real (also called float).
Marking scheme
| Question | Answer | Marks | Guidance | |---|---|---|---| | 1(a) | Real // float | 1 (AO2) | Accept decimal / double / currency. Do not accept integer, string, Boolean or character. Ignore spelling errors if the type is clear. |
Question 11 · short response
2 marks
A leisure centre uses a program to record the number of lanes (from 1 to 8 inclusive) a customer wants to book for a swimming session.
``` 01 lanes = int(input("Enter number of lanes")) 02 while lanes < 1 OR lanes > 8 03 print("Invalid number of lanes") 04 lanes = int(input("Enter number of lanes")) 05 endwhile 06 print("Booked: " + str(lanes)) ```
The programmer is testing the validation in lines 02 to 05.
(a) Give one example of boundary test data that is accepted by the program, and one example of erroneous test data that is rejected by the program. [2]
Boundary test data: ____________________
Erroneous test data: ____________________
Show answer & marking schemeHide answer & marking scheme
Worked solution
Boundary data is of the correct type and at the edge of the valid range. The valid range is 1 to 8, so 1 and 8 are the accepted boundary values. Erroneous data is of an incorrect type, so the program rejects it (int() cannot cast it). Examples are a word such as "six" or a real number such as 4.5.
Marking scheme
| Question | Answer points | Marks | Guidance | |---|---|---|---| | (a) | Boundary test data: 1 // 8 | 1 | Do not accept 0 or 9 (these are boundary values for invalid data, and are rejected). Do not accept a value from the middle of the range, e.g. 4. | | | Erroneous test data: a value of the wrong data type, e.g. a word / letters / symbols / a real number such as 4.5 / blank entry | 1 | Do not accept a number outside the range, e.g. 12 or -3 (this is invalid, not erroneous). Allow a text example given in quotation marks. |
Max 2. Each mark is independent.
Wondering how well you actually know this?
thinka is an AI practice app for GCSE & A-Level students: unlimited questions, instant auto-marking, and detailed step-by-step solutions. 100,000+ students use it to confirm they actually know it, not just think they do.