Class 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 8000 samples every second, and each sample takes 2 bytes. How many bytes does 5 seconds of it take?
2.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?
3.Put these files in order of size, smallest first.
- 20 pixels by 20 pixels, 3 bytes per pixel
- 500 samples a second for 5 seconds, 1 byte each
- 800 characters, 1 byte each
- 45 pixels by 40 pixels, 1 byte per pixel
4.A picture's width and its height are both doubled, and the number of bytes per pixel is left exactly as it was. How many times larger does the picture become?
- a) Six times larger
- b) Eight times larger
- c) Four times larger
- d) Two times larger
5.A colour picture is 200 pixels wide and 150 pixels tall, and 3 bytes are stored for every pixel. How many bytes does it take?
6.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?
7.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
- 1800
- 600
- 1500
- 2400
- 900
8.Sort each of these files by whether it takes more than 10000 bytes.
Groups: More than 10000 bytes · Fewer than 10000 bytes
- 3000 characters, 1 byte each
- 2000 samples a second for 8 seconds, 1 byte each
- 120 pixels by 90 pixels, 1 byte per pixel
- 50 pixels by 40 pixels, 3 bytes per pixel
- 70 pixels by 70 pixels, 3 bytes per pixel
- 60 pixels by 80 pixels, 1 byte per pixel
Answer key — Class 9 Computer Science — Working out a file size
- 1. 80000
- 2. 2
- 3. 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
- 4. c) Four times larger
- 5. 90000
- 6. 1200
- 7. 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
- 8. 60 pixels by 80 pixels, 1 byte per pixel → Fewer than 10000 bytes; 120 pixels by 90 pixels, 1 byte per pixel → More than 10000 bytes; 3000 characters, 1 byte each → Fewer than 10000 bytes; 50 pixels by 40 pixels, 3 bytes per pixel → Fewer than 10000 bytes; 2000 samples a second for 8 seconds, 1 byte each → More than 10000 bytes; 70 pixels by 70 pixels, 3 bytes per pixel → More than 10000 bytes