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 | |
|---|---|---|
| 1echo = receive(data) | AIF echo != original THEN resend(data) | |
| 2IF echo == original THEN | BIn an echo check the sender compares the echo it gets back with the original it sent. The check happens after the receiver sends the copy back, not before sending. | |
| 3A mismatch between the echo and the original means the data must be sent again | CThe sender compares the echo with what it sent; a match means no error was detected. | |
| 4The receiver echoes the data back to the sender after receiving it | Dsend(echo, sender) | |
| 5The sender checks the data before it is sent, so no echo is needed | EResending on a match is wrong. A match means no error was detected, so the data is only sent again when the echo does not match. | |
| 6IF echo == original THEN resend(data) | FThe receiver takes in the data and keeps a copy to send back to the sender as an echo. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
echo check — The receiver sends a copy of the received data back to the sender, who compares it with the original. A match means no error was detected; a mismatch means the data is sent again.SEND sent TO receiver
RECEIVE echo FROM receiver
IF echo = sent THEN OUTPUT "OK"IF echo <> sent THEN
SEND sent AGAIN
ENDIFsender: SEND data TO receiver
receiver: ECHO data BACK TO sender
sender: COMPARE reply WITH dataIF echo = sent THEN OUTPUT "No error"
ELSE
SEND sent AGAINSEND sent TO receiver
RECEIVE copy FROM receiver
COMPARE copy WITH sent