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 | |
|---|---|---|
| 1file_bytes <= free_bytes | AThe file fits because both sizes are in bytes and the file is not bigger than the free space | |
| 2files = capacity // file_size | BThe numbers are in different units: 5 is in MiB but 4096 is in KiB. Comparing them directly is wrong. | |
| 3Convert a 2 GiB drive into MiB before comparing it with a 1500 MiB sound file | CWorks out how many whole files fit in the storage, after both sizes are in the same unit | |
| 4Find how many 4 MiB images fit on a 64 MiB card | D64 / 4 = 16 images | |
| 55 MiB file on 4096 KiB: 5 <= 4096, so it fits | EThe file size is in GiB and the drive is in MiB, so comparing 3 with 2048 is not a fair check. | |
| 6File 3 GiB, drive 2048 MiB: 3 <= 2048, so it fits | F2 * 1024 = 2048 MiB, so 1500 <= 2048 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
file size <= capacity — A file fits if its size is less than or equal to the free space. First convert both to the same unit, such as bytes or MiB, then compare the two numbers.IF fileSize <= freeSpace THENfreeBytes ← freeMiB * 1024 * 1024freeMiB ← 100
fileMiB ← 8
numFiles ← freeMiB DIV fileMiBIF fileMiB <= freeMiB THENimageMiB ← 350
driveMiB ← 2048
IF imageMiB <= driveMiB THEN