Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1Received: 1, 2, 4, 5 | AOnly four of the five packets arrived. The numbers skip 3, so packet 3 is missing and the message is incomplete. | |
| 2Packet 2 of 5 | BThe total is 5, so packet 5 is missing. The receiver must check the numbers against the total, not just look for gaps in the middle. | |
| 3A gap in the packet numbers shows a packet is missing and the message is incomplete | CThe total packet count is 5, so the receiver expects numbers 1 to 5 | |
| 4After spotting a missing packet, the receiver asks the sender for a resend | Dif 3 not in received: missing = 3 | |
| 5Received 1, 2, 4, 5 of 5: all packets arrived | Esend('Please resend packet 3') | |
| 6Received 1, 2, 3, 4 of 5: complete | FPacket 3 is missing, because there is a gap in the numbers |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
missing packet — A gap in the packet numbers received, like 1, 2, 4, 5, shows a packet is missing. The receiver knows the message is incomplete and can ask for a resend.received ← [1, 2, 4, 5]
DISPLAY "Packet " + 3 + " is missing"IF LENGTH(received) < total THEN
DISPLAY "Please resend packet 3"
END IFIF 3 NOT IN received THEN
DISPLAY "Packet 3 is missing"
END IFFOR n = 1 TO total
IF n NOT IN received THEN DISPLAY n
NEXT nIF LENGTH(received) = total THEN
DISPLAY "Message complete"
ELSE DISPLAY "Resend missing packet"