Grade 9 Computer Science — Working out a file size
Work out how many bytes a picture, a piece of text or a recording takes up, from how many things are in it and how many bytes one of those things needs.
Name: ________________________
1.A recording stores 16000 samples every second, each sample taking 2 bytes, and it lasts 3 seconds. How many bytes does the recording take?
2.One picture is 100 pixels by 80 pixels with 1 byte per pixel. Another is 50 pixels by 40 pixels with 3 bytes per pixel. Which is larger, and by how much?
- a) The first, by 4000 bytes
- b) The first, by 2000 bytes
- c) The two are exactly the same size
- d) The second, by 2000 bytes
3.A picture is 40 pixels wide and 30 pixels tall, and 1 byte is stored for every pixel. How many bytes does the picture take?
4.Match each file to the number of bytes it takes.
- 24 pixels by 25 pixels, 1 byte per pixel
- 1500 characters, 1 byte each
- 30 pixels by 30 pixels, 2 bytes per pixel
- 400 samples a second for 6 seconds, 1 byte each
- 20 pixels by 15 pixels, 3 bytes per pixel
- 1500
- 900
- 600
- 1800
- 2400
5.A picture is 64 pixels wide and 32 pixels tall, with 1 byte per pixel, and one kilobyte is 1024 bytes. How many kilobytes is the picture?
6.Put these files in order of size, smallest first.
- 500 samples a second for 5 seconds, 1 byte each
- 20 pixels by 20 pixels, 3 bytes per pixel
- 45 pixels by 40 pixels, 1 byte per pixel
- 800 characters, 1 byte each
7.A color picture is 200 pixels wide and 150 pixels tall, and 3 bytes are stored for every pixel. How many bytes does it take?
8.A picture takes 7200 bytes altogether and stores 2 bytes for every pixel. How many pixels does the picture have?
Answer key — Grade 9 Computer Science — Working out a file size
- 1. 96000
- 2. b) The first, by 2000 bytes
- 3. 1200
- 4. 24 pixels by 25 pixels, 1 byte per pixel → 600; 1500 characters, 1 byte each → 1500; 30 pixels by 30 pixels, 2 bytes per pixel → 1800; 400 samples a second for 6 seconds, 1 byte each → 2400; 20 pixels by 15 pixels, 3 bytes per pixel → 900
- 5. 2
- 6. 1. 800 characters, 1 byte each 2. 20 pixels by 20 pixels, 3 bytes per pixel 3. 45 pixels by 40 pixels, 1 byte per pixel 4. 500 samples a second for 5 seconds, 1 byte each
- 7. 90000
- 8. 3600