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 | |
|---|---|---|
| 1report.txt -> report.zip -> report.txt | AZIP is lossless, so unzipping must give back the exact original file, not a slightly different one. | |
| 2photo.bmp -> photo.png | BLosing words means this is not lossless. Text must be restored exactly, so lossless compression is needed. | |
| 3Lossless compression is needed for programs, because one missing or changed bit could break them | Cgame.exe -> game.zip -> game.exe | |
| 4After lossless compression, decompressing gives data identical to the original | DThe image file gets smaller but every original pixel can still be restored exactly | |
| 5essay.docx -> compress -> 'a few words missing' -> OK | Eoriginal == restored # True | |
| 6ZIP file -> unzip -> slightly different file | FThe file is shrunk into a ZIP and then unzipped to get back the exact original, with nothing lost |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
lossless compression — Shrinks a file so the exact original data can be rebuilt perfectly, with nothing lost. ZIP and PNG use it. Needed for text and programs.compressed ← compress(original)
restored ← decompress(compressed)restored ← decompress(compressed)
IF restored = original THEN
OUTPUT "Lossless"IF format = "ZIP" OR format = "PNG" THEN
type ← "lossless"needsExact ← TRUE
IF needsExact THEN
method ← "lossless"zipFile ← compress(original)
copy ← decompress(zipFile)
differences ← 0