1 - Theory of Computer Science / Binary & Files
|
|
Exam Questions - Binary & Files
Example Question 1
Reveal Answer
2
(a) Question 2 (a) asks you to describe how a photo is taken and stored as a digital photo file on a computer. The emphasis on detail here should be on how a bitmap image is made / stored. Any 4 of the following points would each get 1 mark ( Max 4 marks)
(b) Question 2 (b) asks about file compression. Nancy has images that need to be transmitted via email. The question lets you know that the most important thing here is that the files should be compressed as small as possible.
The correct compression type to choose here is
Compression type = Lossy
Lossy is he correct answer as it allows the file size to be smaller than lossless.
Explanation.
3 marks are available for the explanation. Each of the following points would be worth one mark each.
(a) Question 2 (a) asks you to describe how a photo is taken and stored as a digital photo file on a computer. The emphasis on detail here should be on how a bitmap image is made / stored. Any 4 of the following points would each get 1 mark ( Max 4 marks)
- Image is converted from analogue to digital using an ADC
- Image is turned into pixels
- Each pixel is given a binary value
- Pixels form a grid
- Each pixel has a colour
- Pixels are stored in sequence in a file
- Meta data is stored
- An example of a suitable photo format e.g. jpeg
(b) Question 2 (b) asks about file compression. Nancy has images that need to be transmitted via email. The question lets you know that the most important thing here is that the files should be compressed as small as possible.
The correct compression type to choose here is
Compression type = Lossy
Lossy is he correct answer as it allows the file size to be smaller than lossless.
Explanation.
3 marks are available for the explanation. Each of the following points would be worth one mark each.
- Lossy will reduce the file size more than lossless
- The redundant data can be removed from the files
- Images can still be of similar quality
- There is no requirement for the files to be exactly the same as the original
- Photos can be sent quicker / faster to upload / faster to download
Example Question 2
Reveal Answer
4
(a) Question 4 (a) is asking for you to name the two main types of compression:
Answers
Compression type 1 : Lossy
Compression type 2: Lossless
The order of the above answers does not matter.
(b) Question 4 (b) is asking for the most sutable compression type for the source code of a program and why:
Answers
Compression Type: Lossy
Explanation:
Any 3 of the following points would earn a mark:
(a) Question 4 (a) is asking for you to name the two main types of compression:
Answers
Compression type 1 : Lossy
Compression type 2: Lossless
The order of the above answers does not matter.
(b) Question 4 (b) is asking for the most sutable compression type for the source code of a program and why:
Answers
Compression Type: Lossy
Explanation:
Any 3 of the following points would earn a mark:
- The file can be restored/decompressed to the exact same state it was before compression
- It is a computer program so no data can be lost / Lossy would remove data
- The code will not run correctly if lossy is used
- Lossless will give repeating words / sections of words a value // RLE is used // other valid methods of lossless compression
- Value is recorded in an index.
Example Question 3
Reveal Answer
1
(a) Question 1 (a) Requires you to recognize which file extension matches which type of file. You are required to draw lines that connect the matching file types and file extensions:
Answer:
(a) Question 1 (a) Requires you to recognize which file extension matches which type of file. You are required to draw lines that connect the matching file types and file extensions:
Answer:
(b) Question 1 (b) requires you to find out the file size of an image. You are given space to work out the answer:
Resolution = 150 X 100 Pixels.
150 X 100 = 15000 Pixels total
There are 8 bits for every pixel so all we have to do now is divide 15000 by 1024 to determine the number of Kilobytes.
15000 / 1024 = 14.65
Answer = 14.65KB
Resolution = 150 X 100 Pixels.
150 X 100 = 15000 Pixels total
There are 8 bits for every pixel so all we have to do now is divide 15000 by 1024 to determine the number of Kilobytes.
15000 / 1024 = 14.65
Answer = 14.65KB
Example Question 4
Reveal Answer
(c) Question (c) asks you to explain how a file is compressed using lossless compression. Each of the following points would earn 1 mark (Max 3 marks)
Answers:
Answers:
- A Compression algorithm is used
- No data is lost in the process
- Repeated words / patterns can be indexed
- Indexed words / patterns can be replaced with numerical values
(b) Question (b) ask you to tick in a box to identify which type of compression each file type uses.
Answers:
Example Question 5
Reveal Answer
13
(a) Question 13 (a) asks you to list the benefits of compressing a large file when transmitting it over the internet. There are two marks on offer so two points should be given.
Each of the following points are worth 1 mark (Max 2)
Answers
(a) Question 13 (a) asks you to list the benefits of compressing a large file when transmitting it over the internet. There are two marks on offer so two points should be given.
Each of the following points are worth 1 mark (Max 2)
Answers
- smaller file to transmit
- The file is transmitted quicker
- Uses / requires less bandwidth
(b)
(i) Question B (i) asks you which type of compression is best for downloading computer code. It is worth 3 marks so you should give the compression name and two reasons why.
Answers
Lossless (Compression)
- ... it is important the code must be (exactly) the same as the original file
- ... If it does not match the original file it will not work
(ii) Question B (ii) asks you which type of compression is best for streaming a video file. It is worth 3 marks so you should give the compression name and two reasons why.
Answers
Lossy (Compression)
- ...it would make the file smaller than lossless compression / the file would stream faster than lossless compression
- ... the quality of the video can be reduced but it can still be viewed
Example Question 6
Reveal Answer
(b)
Question (b) asks you to calculate a file size in bytes. The question has 1 mark available for the answer and one for your working out. Make sure that you show your working out even if you do not think that you need it.
Working out
1000 pixels
16 bit colour image = 16 bits per pixel
Total bits = 1000 (Pixels) X 16 (bits) = 16000 bits
16000 / 8 = 2000 (bytes)
Answer
2000 bytes.
Question (b) asks you to calculate a file size in bytes. The question has 1 mark available for the answer and one for your working out. Make sure that you show your working out even if you do not think that you need it.
Working out
1000 pixels
16 bit colour image = 16 bits per pixel
Total bits = 1000 (Pixels) X 16 (bits) = 16000 bits
16000 / 8 = 2000 (bytes)
Answer
2000 bytes.