Showing free chapters only. Upgrade to Pro to practise all chapters.
Showing 341 questions
Q1[6 marks]easyCh1 · Information representation and multimedia· Converting from binary to denary and from denary to binaryAO2
Computers store and process information using the binary number system. Understanding how to convert between binary and denary is fundamental to working with computer data.
(a) Convert the denary number 75 into an 8-bit binary number. [2]
(b) Convert the binary number 10110101 into its denary equivalent. [2]
(c) State the largest denary number that can be represented using 8 bits. [2]
Q2[8 marks]mediumCh1 · Information representation and multimedia· Data representationAO1
Computers represent all data using binary digits. Understanding how these fundamental units are structured is crucial for processing information.
(a) Define the term 'bit' in the context of data representation. [2]
(b) Draw a simple diagram to show how the denary number 5 can be represented using 4 bits. [3]
(c) Explain how increasing the number of bits used to represent data affects the precision or range of values that can be stored. [3]
Q3[10 marks]mediumCh1 · Information representation and multimedia· Binary addition and subtractionAO2
Two's complement is a standard method used by computers to represent negative numbers and perform subtraction using addition logic.
(a) Perform the binary subtraction 01101001 - 00101100 using two's complement. Show all steps. [4]
(b) Convert the denary number -45 into an 8-bit two's complement binary number. [2]
(c) Explain why two's complement is preferred over one's complement for representing negative numbers in computer systems. [4]
Q4[8 marks]mediumCh1 · Information representation and multimedia· Run-length encoding (RLE)AO2AO3
Run-Length Encoding (RLE) is a simple lossless data compression technique that can be effective for data with long sequences of identical values.
(a) Apply Run-Length Encoding (RLE) to the following sequence of text data: AAAAAABBBCCCDDEEEEE. [3]
(b) Explain why RLE is considered a lossless compression technique. [3]
(c) Calculate the compression ratio achieved by RLE for the data in part (a), assuming each original character takes 1 byte and each RLE pair (count, character) takes 2 bytes. [2]
Q5[6 marks]easyCh1 · Information representation and multimedia· Converting from binary to hexadecimal and from hexadecimal to binaryAO2AO1
Number systems are fundamental to how computers store and process data. Programmers often use hexadecimal for convenience.
(a) Convert the binary number 10110011 to its hexadecimal equivalent. [2]
(b) Convert the hexadecimal number 7D to its binary equivalent. [2]
(c) State why hexadecimal is often preferred over binary for representing large numbers in computing. [2]
Q6[8 marks]mediumCh1 · Information representation and multimedia· Calculating bit-map image file sizesAO2
Digital cameras capture and store images as bit-maps. The size of these image files depends on factors such as resolution and colour depth.
(a) A camera captures an image with a resolution of 4000 x 3000 pixels and stores it with a colour depth of 16 bits. Calculate the file size of this image in kilobytes (KB). [4]
(b) Determine the maximum number of distinct colours that can be represented by a colour depth of 8 bits. Show your calculation. [4]
Q7[8 marks]mediumCh1 · Information representation and multimedia· Using RLE on text dataAO1AO2
Run-Length Encoding (RLE) is a lossless data compression technique that can be applied to text data to reduce its storage size.
(a) Outline the steps involved in decompressing a text string that has been compressed using Run-Length Encoding. [3]
(b) Draw a flowchart to represent the RLE compression process for a given text string, clearly showing input, processing steps, and output. [3]
(c) Analyse a situation where RLE might not be effective for compressing text data, providing an example. [2]
Q8[10 marks]hardCh1 · Information representation and multimedia· Converting from binary to denary and from denary to binaryAO2AO3
The binary number system forms the basis of all digital computing. Understanding its structure, particularly positional weighting, is crucial for data representation.
(a) Convert the denary number 137 into an 8-bit binary number. [3]
(b) Convert the 8-bit binary number 11010110 into its denary equivalent. [3]
(c) Draw a simple diagram to illustrate the concept of positional weighting in the binary number system, using a 4-bit example. [4]
Q9[5 marks]easyCh1 · Information representation and multimedia· Black and white imagesAO1AO2
Digital images are represented using pixels. The way these pixels are stored affects the image's file size and quality.
(a) State the number of bits required to represent each pixel in a black and white image. [1]
(b) Explain why black and white images are often chosen for applications where storage space or transmission bandwidth is limited. [2]
(c) Calculate the file size in bytes for a black and white image with a resolution of 100 pixels by 50 pixels. [2]
Q10[6 marks]easyCh1 · Information representation and multimedia· Binary-coded decimal (BCD) systemAO1AO2
Number systems are fundamental to how computers store and process data. One such system is Binary-Coded Decimal (BCD).
(a) Define Binary-Coded Decimal (BCD). [2]
(b) Convert the denary number 873 to its 12-bit BCD equivalent. [4]
Q11[10 marks]hardCh1 · Information representation and multimedia· Comparison between vector graphics and bit-map imagesAO1AO3
Digital images are fundamental to modern computing, but they can be represented in different ways, each with distinct advantages and disadvantages. Two primary methods are bit-map images and vector graphics.
(a) Describe how a bit-map image is represented digitally. [3]
(b) Compare the storage requirements and scalability of vector graphics and bit-map images. [4]
(c) A company needs to design a new logo that will be used on everything from business cards to large billboards. Justify whether vector graphics or bit-map images would be more suitable for this task. [3]
Q12[6 marks]easyCh1 · Information representation and multimedia· Hexadecimal number systemAO2AO1
The hexadecimal number system is widely used in computing to represent binary data more concisely.
(a) Convert the hexadecimal number 3F8 to its denary equivalent. [3]
(b) Identify two common uses of the hexadecimal number system in computing. [3]
Q13[10 marks]hardCh1 · Information representation and multimedia· Photographic (bit-map) imagesAO1AO2AO3
Bit-map images are widely used for photographs and complex graphics due to their ability to represent intricate details. However, their quality can be significantly affected by how they are created and displayed.
(a) Discuss the impact of image resolution and pixel density on the perceived quality of a bit-map image when viewed on different screen sizes. [4]
(b) Sketch a small 4x4 grid representing a simple black and white bit-map image and shade the pixels to represent the letter 'L'. [3]
(c) Explain why bit-map images often suffer from pixelation when scaled up significantly. [3]
Q14[8 marks]mediumCh1 · Information representation and multimedia· Vector graphicsAO1AO3
Vector graphics are widely used in design and illustration due to their scalability.
(a) Explain how a circle is represented in a vector graphics file. [3]
(b) Describe the effect of zooming in on a vector graphic image. [2]
(c) Sketch a simple diagram showing how two vector shapes, a rectangle and a triangle, could be layered to form a house-like image. Label the key components. [3]
Q15[10 marks]hardCh1 · Information representation and multimedia· Binary number systemAO2AO3
The binary number system is the foundation of all digital computing. Understanding its conversion to and from denary, and its limitations, is crucial.
(a) Convert the denary number 157 to an 8-bit binary number. [3]
(b) Convert the 8-bit binary number 10110110 to its denary equivalent. [3]
(c) Explain why 8-bit binary numbers have a limited range for positive integers and calculate this range. [4]
Q16[9 marks]mediumCh1 · Information representation and multimedia· Coloured imagesAO2
Images on computer screens are often stored as bit-maps, where each pixel's colour is represented by a binary code.
Fig 1.1 shows a small section of a bit-map image.
(a) Interpret the colour depth from the provided image data in Fig 1.1. [2]
(b) Using the data from Fig 1.1, calculate the total number of unique colours that can be represented by the image. [4]
(c) Explain how increasing the resolution of a coloured image, while keeping the colour depth constant, affects its file size and visual quality. [3]
Q17[6 marks]easyCh1 · Information representation and multimedia· File compressionAO1
File compression is a technique used to reduce the size of data files, making them easier to store and transmit. There are different methods of compression, each with specific characteristics and applications.
(a) Define the term 'lossless file compression'. [2]
(b) Define the term 'lossy file compression'. [2]
(c) Identify two types of files that typically use lossless compression. [2]
Q18[10 marks]hardCh1 · Information representation and multimedia· Black and white imagesAO1AO2AO3
Digital images form a fundamental part of multimedia content. The way images are stored and processed depends on their characteristics, such as colour depth and resolution.
(a) Explain the concept of 'bit depth' in the context of image representation, specifically for black and white images. [3]
(b) Discuss the advantages and disadvantages of using black and white images compared to colour images in digital applications, considering factors beyond just file size. [4]
(c) A black and white image has a resolution of 640 x 480 pixels. Calculate the total file size in kilobytes (KB), assuming 1 KB = 1024 bytes. [3]
Q19[6 marks]easyCh1 · Information representation and multimedia· General methods of compressing filesAO1AO3
File compression is an essential technique in modern computing, helping to manage storage and transmission of digital data.
(a) State two reasons why file compression is used. [2]
(b) Explain the difference between lossless and lossy file compression. [4]
Q20[10 marks]hardCh1 · Information representation and multimedia· File compression applicationsAO1AO3
Digital media files, such as images, audio, and video, often require compression for efficient storage and transmission.
(a) Compare the characteristics and suitable applications of lossless and lossy file compression methods. [5]
(b) Discuss the impact of using MP3 compression on the quality and file size of an audio recording, explaining the underlying principle of perceptual music shaping. [5]
Q21[10 marks]hardCh1 · Information representation and multimedia· ASCII codes and UnicodesAO1AO3
Character encoding systems are fundamental to how computers represent and process text. ASCII was an early standard, but Unicode has largely superseded it.
(a) Compare ASCII and Unicode in terms of the number of characters they can represent and their primary purpose. [4]
(b) Explain why Unicode was developed as a successor to ASCII. [3]
(c) State the relationship between the first 128 Unicode characters and the ASCII character set. [3]
Q22[8 marks]mediumCh1 · Information representation and multimedia· Number systemsAO1AO3
Different number systems are used in computing for various purposes, each with its own advantages and applications.
(a) Explain why different number systems are used in computing, with reference to human readability and machine processing. [3]
(b) Describe the term 'base' as it applies to number systems, using an example. [3]
(c) Give an example of a number system with a base greater than 10, apart from hexadecimal. [2]
Q23[10 marks]hardCh1 · Information representation and multimedia· Memory dumpsAO1AO2AO3
When a computer program encounters a critical error, it may generate a memory dump. This is a snapshot of the contents of the computer's memory at the time of the crash.
(a) Analyse the purpose of a memory dump and why it is displayed in hexadecimal format. [4]
(b) A section of a memory dump shows the hexadecimal value 41. Convert this value to its ASCII character equivalent and then to binary. [3]
(c) Explain how a programmer might use a memory dump to debug a software error. [3]
Q24[9 marks]mediumCh1 · Information representation and multimedia· Binary-coded decimal (BCD) systemAO1AO2AO3
Binary-coded Decimal (BCD) is a system where each denary digit is represented by its own 4-bit binary code. Fig 1.1 illustrates the BCD representation of a two-digit denary number.
Fig 1.1
(a) Convert the denary number 149 to its 12-bit BCD equivalent. [3]
(b) Show the BCD representation of the denary number 52, as depicted in Fig 1.1. [3]
(c) Calculate the largest denary number that can be represented using 16 bits in BCD. [3]
Q25[8 marks]mediumCh1 · Information representation and multimedia· Coloured imagesAO1AO2AO3
Digital images are fundamental to modern computing, with coloured images requiring specific methods for storing and displaying a wide range of hues.
(a) Explain how colour depth affects the quality and file size of a coloured image. [3]
(b) A coloured image has a resolution of 1920 x 1080 pixels and a colour depth of 24 bits. Calculate the uncompressed file size in megabytes (MB). [3]
(c) Describe one method used to represent colour in digital images, other than simply storing the colour depth for each pixel. [2]
Q26[8 marks]mediumCh1 · Information representation and multimedia· Measurement of the size of computer memoriesAO2AO3
Modern computers often use solid-state drives (SSDs) for storage due to their speed and durability.
(a) A solid-state drive (SSD) has a capacity of 2 TB. Calculate this capacity in bytes, showing your working. [4]
(b) Explain the difference between a kilobyte (KB) and a kibibyte (KiB) in terms of their values and why this distinction is important in computer science. [4]
Q27[8 marks]mediumCh1 · Information representation and multimedia· VideoAO1AO2
Video files are composed of a sequence of images (frames) displayed rapidly. The quality and size of a video file depend on several factors, including resolution, colour depth, and frame rate.
(a) Explain what is meant by 'frame rate' in the context of video. [3]
(b) A video uses a resolution of 1920 x 1080 pixels, a colour depth of 24 bits, and a frame rate of 30 frames per second. Calculate the uncompressed file size in Gigabytes for a 5-minute video. Show your working. [5]
Q28[8 marks]mediumCh1 · Information representation and multimedia· Bit-map imagesAO1AO3
Digital images are fundamental to modern computing and are represented in various ways. Fig 1.1 shows a magnified section of a bit-map image.
(a) Explain how a bit-map image is represented digitally. [4]
(b) Describe the impact of increasing the colour depth of a bit-map image on its visual quality and file size. [4]
Q29[10 marks]mediumCh1 · Information representation and multimedia· Binary addition and subtractionAO2
Binary numbers are fundamental to how computers store and process data. Operations like addition and subtraction are performed at this low level.
Fig 1.1 shows two 8-bit binary numbers aligned for addition.
Number 1: 0 1 1 1 0 1 0 1
Number 2: 0 0 1 0 1 0 1 1
-----------------------------
Carries: _ _ _ _ _ _ _ _
Sum: _ _ _ _ _ _ _ _
(a) Perform the binary addition of 01110101 and 00101011, showing any carries in the designated row. Represent your answer as an 8-bit binary number. [4]
(b) Identify the denary equivalents of the two binary numbers from part (a) and the denary equivalent of your answer. [3]
(c) Explain the significance of the carry bit in binary addition operations. [3]
Q30[6 marks]easyCh1 · Information representation and multimedia· MPEG-3 (MP3) and MPEG-4 (MP4)AO1
Digital media formats like MP3 and MP4 have become standard for storing and distributing audio and video content.
(a) State the primary purpose of MP3 files. [2]
(b) Describe two key differences between MP3 and MP4 file formats, focusing on the types of data they typically store. [4]
Q31[8 marks]mediumCh1 · Information representation and multimedia· Uses of BCDAO1AO3
A digital clock or calculator often displays numbers in denary format, requiring constant conversion if internal calculations are performed in pure binary. Binary-coded Decimal (BCD) is an alternative number system sometimes used in these devices.
(a) Explain why BCD is often used in digital clocks and calculators, despite being less efficient than pure binary for storing numerical values. [4]
(b) Identify two specific scenarios where BCD's direct mapping to denary digits is advantageous, providing a brief justification for each. [4]
Q32[9 marks]mediumCh1 · Information representation and multimedia· Hexadecimal number systemAO2AO3
Hexadecimal is often used as a shorthand for binary sequences in computing.
(a) Convert the binary number 1011010111001010 to its hexadecimal equivalent. [4]
(b) Explain how hexadecimal is used in memory dumps, referring to the advantages it offers over binary representation for this purpose. [5]
Q33[7 marks]mediumCh1 · Information representation and multimedia· ASCII codes and UnicodesAO1AO2
ASCII is a character encoding standard for electronic communication. It primarily represents text in computers, telecommunications equipment, and other devices. Fig 1.2 shows a partial ASCII table.
Fig 1.2
(a) Identify the ASCII code (in denary) for the character 'A' and the character 'a' based on the provided ASCII table structure in Fig 1.2. [3]
(b) Explain how the structure of ASCII codes, as partially shown in Fig 1.2, allows for efficient representation of English text, and why this becomes a limitation for other languages. [4]
Q34[10 marks]mediumCh1 · Information representation and multimedia· Run-length encoding (RLE)AO1AO2AO3
Run-Length Encoding (RLE) is a lossless data compression technique that reduces the physical size of a file by storing sequences of identical data values as a single data value and its count.
Fig 1.1 shows a simple black and white image represented by a grid of pixels.
(a) Describe how Run-Length Encoding (RLE) would be applied to compress this image row by row. [4]
(b) Analyse the effectiveness of RLE for an image that is highly detailed with very few repeating pixel sequences. [3]
(c) Evaluate one advantage and one disadvantage of using RLE for compressing coloured images compared to black and white images. [3]
Q35[8 marks]mediumCh1 · Information representation and multimedia· Binary additionAO2AO3
Binary addition is a fundamental operation performed by the Arithmetic Logic Unit (ALU) within a computer's Central Processing Unit (CPU).
(a) Perform the binary addition of 01011010 and 00110111. Show your working. [4]
(b) Explain what happens if the result of a binary addition exceeds the number of bits available, using an example. [4]
Q36[9 marks]mediumCh1 · Information representation and multimedia· Binary number systemAO1AO2
Computers process information using the binary number system. Fig 1.1 shows a table of denary numbers and their 4-bit binary equivalents.
**Fig 1.1**
Denary
Binary
0
0000
1
0001
2
0010
3
0011
4
0100
5
0101
6
0110
7
0111
8
1000
9
1001
10
1010
(a) Identify the binary value corresponding to the denary number 7 from the table. [2]
(b) Determine the denary equivalent of the binary number 1101, showing your working. [3]
(c) Explain the pattern observed in the binary representation as the denary numbers increase, and how this relates to powers of two. [4]
Q37[9 marks]mediumCh1 · Information representation and multimedia· Sound filesAO1AO2
Digital sound recording involves converting analogue sound waves into a digital format. This process requires decisions about how the sound is sampled to achieve a desired quality and file size.
(a) Explain the terms 'sampling rate' and 'sampling resolution' in the context of digital sound recording. [3]
(b) A sound file is recorded with a sampling rate of 44.1 kHz and a sampling resolution of 16 bits. Calculate the file size in megabytes for a 3-minute stereo recording. Show your working. [4]
(c) Briefly discuss one advantage of increasing the sampling rate when recording sound. [2]
Q38[8 marks]mediumCh1 · Information representation and multimedia· Use of the hexadecimal systemAO1AO3
The hexadecimal number system is widely used in computer science for various purposes due to its efficiency in representing binary data.
(a) Explain two common uses of the hexadecimal number system in computer science, other than memory dumps. [3]
(b) Identify the hexadecimal colour code for pure red. [2]
(c) A memory address is given as F0A9 in hexadecimal. If the next address is F0AA, calculate the denary difference between these two addresses. [3]
Q39[7 marks]mediumCh1 · Information representation and multimedia· Bit-map imagesAO1
Bit-map images are a common way to represent graphical data. Fig 1.2 shows a small, low-resolution bit-map image that has been significantly enlarged.
(a) State the definition of a pixel. [2]
(b) Explain why a bit-map image can appear 'pixelated' when it is significantly enlarged. [5]
Q40[10 marks]hardCh1 · Information representation and multimedia· Calculating bit-map image file sizesAO2
Digital cameras capture images which are then stored as bit-maps on a computer.
(a) Calculate the file size in megabytes (MB) of a bit-map image with a resolution of 1920 x 1080 pixels and a colour depth of 24 bits. Show your working. [4]
(b) Discuss two factors, other than resolution and colour depth, that can affect the actual file size of an image stored on a computer, explaining how each factor influences the size. [6]
Q41[6 marks]easyCh1 · Information representation and multimedia· Vector graphicsAO1
Computer graphics can be represented in different ways, including vector graphics and bit-map images.
(a) Define the term 'vector graphics'. [2]
(b) Identify two common properties that are stored for a line segment in a vector graphic. [2]
(c) State one typical application where vector graphics are preferred over bit-map images. [2]
Q42[7 marks]mediumCh1 · Information representation and multimedia· VideoAO1
Digital video plays a crucial role in modern communication and entertainment, but its storage and transmission require significant data handling.
(a) Outline how a digital video is constructed from individual frames. [3]
(b) Explain the relationship between resolution, colour depth, and frame rate on the overall quality and uncompressed file size of a video. [4]
Q43[5 marks]easyCh1 · Information representation and multimedia· Data representationAO1
Computers process and store information in a digital format, distinct from the analogue signals found in the natural world.
(a) State two fundamental differences between analogue and digital data. [2]
(b) Identify three everyday examples of digital data. [3]
Q44[5 marks]easyCh1 · Information representation and multimedia· MultimediaAO1
Modern computer applications often integrate various forms of content to enhance user experience.
(a) Define the term 'multimedia'. [2]
(b) Identify three common types of media that are typically integrated into a multimedia presentation. [3]
Q45[9 marks]mediumCh1 · Information representation and multimedia· Photographic (bit-map) imagesAO1AO2
Bit-map images are widely used for photographs and complex graphics, storing image data as a grid of individual picture elements.
(a) Define the term 'pixel' in the context of bit-map images. [2]
(b) Calculate the file size in megabytes (MB) for a bit-map image with a resolution of 3840 x 2160 pixels and a colour depth of 24 bits. Show your working. [4]
(c) Explain how increasing the colour depth of a bit-map image affects its visual quality and file size. [3]
Q46[8 marks]mediumCh1 · Information representation and multimedia· Using RLE with imagesAO1AO2AO3
Run-Length Encoding (RLE) is a lossless compression technique that can be applied to both text and image data.
(a) Describe how Run-Length Encoding (RLE) is typically applied to image data. [2]
(b) Fig 1.1 shows a single row of pixels in a black and white image.
WWWWBBWWWBBB
Apply RLE to the first row of pixels shown in Fig 1.1. Assume 'W' represents white and 'B' represents black. Show the compressed output. [4]
(c) Calculate the number of bytes saved by compressing the row in Fig 1.1 using RLE, assuming each original pixel takes 1 byte and each RLE pair takes 2 bytes. [2]
Q47[10 marks]hardCh1 · Information representation and multimedia· General methods of compressing filesAO3
Digital media files are frequently compressed for storage and transmission, with different compression methods offering varying trade-offs between file size and quality.
(a) Analyse the suitability of using lossy compression for a high-quality medical scan image compared to a video file for online streaming. [4]
(b) Evaluate the impact of high compression ratios on the quality and usability of digital media. [3]
(c) Explain how perceptual music shaping contributes to the effectiveness of audio compression methods like MP3. [3]
Q48[9 marks]mediumCh1 · Information representation and multimedia· General methods of compressing filesAO2AO3
File compression is a vital technique for managing digital data, allowing for more efficient storage and transmission. Various methods exist, each with its own strengths and weaknesses.
(a) Apply Run-Length Encoding (RLE) to the following sequence of characters: AAAAABBBCCDDDAAAA [4]
(b) Discuss the effectiveness of RLE for compressing images with large areas of solid colour compared to highly detailed, photographic images. [3]
(c) Sketch a simple diagram showing how a file might be compressed and then decompressed, indicating where information might be lost in a lossy compression scenario. [2]
Q49[8 marks]mediumCh1 · Information representation and multimedia· Converting from binary to hexadecimal and from hexadecimal to binary
Fig 1.1 shows conversion methods for binary and hexadecimal numbers.
(a) Convert the binary number 10000111111101 from Example 1.6 into its hexadecimal equivalent. Show all steps.
(b) Convert the hexadecimal number 'A7' from Example 1.7 to its binary equivalent.
(c) Describe one practical use of hexadecimal numbers in computer science, referring to the ease of conversion with binary.
Q50[10 marks]hardCh1 · Information representation and multimedia· Binary subtraction
Fig 1.3 outlines a binary subtraction problem: 49 - 80.
(a) Convert both 49 and 80 into their 8-bit two's complement binary representations.
[4]
(b) Perform the subtraction 49 - 80 using 8-bit two's complement binary addition. Show all working, including any carries, and the final 8-bit binary result.
[4]
(c) Justify whether the final result obtained in part (b) is correct, by converting it back to denary.
[2]
Q51[5 marks]mediumCh1 · Information representation and multimedia· Binary addition
Fig 1.1 shows the setup for a binary addition problem.
(a) Perform the binary addition of 00100101 and 00111010, showing all carries clearly in the space provided in Fig 1.1.
[3]
(b) State the denary equivalent of the sum obtained in part (a).
[2]
Q52[8 marks]mediumCh1 · Information representation and multimedia· Hexadecimal number system
Fig 1.2 shows the relationship between 4-bit binary values, their hexadecimal equivalents, and their denary values.
(a) Convert the hexadecimal value 'F' to its 4-bit binary equivalent using the information in Fig. 1.2.
(b) Explain why hexadecimal is often used in memory dumps, as opposed to pure binary, referring to the relationship shown in Fig. 1.2.
(c) A colour is represented by the hexadecimal value #FF00CC. Convert this hexadecimal value to its denary RGB components. Show your working for at least one component.
Q53[8 marks]mediumCh1 · Information representation and multimedia· Binary-coded decimal (BCD) system
Fig 1.3 shows the relationship between 4-bit binary, hexadecimal, and denary values.
(a) Convert the denary number 73 to its BCD representation.
(b) Explain the key difference between BCD representation and converting a denary number directly to an 8-bit binary number.
(c) Discuss one advantage of using BCD in specific applications, referring to its structure.
Q54[5 marks]easyCh1 · Information representation and multimedia· Converting from binary to hexadecimal and from hexadecimal to binary
Fig 1.4 shows a binary number to be converted to hexadecimal.
(a) Convert the binary number 101111100001 from Fig 1.4 into its hexadecimal equivalent. Show your grouping of binary digits.
[3]
(b) Explain why grouping binary digits in fours is a convenient method for conversion to hexadecimal.
[2]
Q55[5 marks]easyCh1 · Information representation and multimedia· Binary addition
Fig 1.1 shows the setup for the binary addition of two 8-bit numbers.
(a) Perform the binary addition of 01010010 and 01000101, showing all carries clearly in the spaces provided.
0 1 0 1 0 0 1 0
+ 0 1 0 0 0 1 0 1
-------------------
(b) Check your answer by converting the original denary values (82 and 69) and your binary sum to denary, and compare them.
Q56[8 marks]mediumCh1 · Information representation and multimedia· Binary subtraction
Fig 1.2 refers to the subtraction of 95 - 68 in binary.
(a) Convert the denary number 68 to its 8-bit two's complement binary representation.
[3]
(b) Using 8-bit two's complement binary addition, perform the subtraction 95 - 68. Show all working, including the 8-bit two's complement representation of 95 and the final binary sum.
[3]
(c) Explain how the most significant bit of your result in part (b) indicates the sign of the answer.
[2]
Q57[6 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write a procedure `AddSong()` that takes a `NewSongTitle` as a parameter. The procedure finds a free node from the heap, adds the new song title to it, and inserts the node at the end of the playlist.
If the list is full (no free nodes), an appropriate message should be displayed.
Q58[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(ii) The constructor for the `Artwork` class takes the title, artist, and year as parameters, and sets the corresponding attributes. The `IsDigital` attribute should be initialised to `True` by default.
Write program code for the `Artwork` class constructor.
Q59[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A music player uses a linked list to manage a playlist. The linked list is implemented using an array of records.
The node for each song is defined as a record type, `SongNode`.
Field Name
Data Type
Description
`SongTitle`
STRING
The title of the song.
`Pointer`
INTEGER
The index of the next node in the linked list.
A null pointer is represented by the value -1.
**(a)** (i) Write program code to declare the record type (or class) `SongNode`.
Q60[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(i) In the main program, declare an array named `Gallery` that can store 3 `Painting` objects.
Create three `Painting` objects with the following data and store them in the `Gallery` array:
- "Starry Night", "Vincent van Gogh", 1889, "Oil on canvas"
- "The Persistence of Memory", "Salvador Dalí", 1931, "Oil on canvas"
- "The Scream", "Edvard Munch", 1893, "Oil, tempera and pastel on cardboard"
Write program code to perform these actions.
Q61[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
(ii) Write program code to iterate through the `Gallery` array and call the `DisplayDetails()` method for each `Painting` object.
Q62[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
Test your program from part (c).
Provide a screenshot showing the output for all three paintings.
Q63[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
(ii) Rename `Temperatures.txt` to `WeatherData.txt` and run your program again to test your exception handling.
Provide a screenshot showing the output.
Q64[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The function `CalculateAverage()` takes no parameters. It iterates through the `Temperatures` array, calculates the total of all temperatures, and returns the average temperature for the week.
Write program code for the function `CalculateAverage()`.
Q65[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
(i) Create the `Temperatures.txt` file as described in **Appendix A**. Test your complete program.
Provide a screenshot showing the output.
Q66[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(ii) Write the constructor for the `Painting` class. It should take parameters for title, artist, year, and medium. It must call the constructor of the base class. It should set the `IsDigital` attribute to `False` for all paintings.
Q67[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(iv) The class has a public procedure `DisplayDetails()` which outputs the title, artist, and year of the artwork in a user-friendly format.
Write program code for the `DisplayDetails()` procedure.
Q68[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(iii) The `DisplayDetails()` procedure is overridden in the `Painting` class. The new procedure should first call the `DisplayDetails()` procedure from the base class, and then output the medium of the painting on a new line.
Write program code for the overridden `DisplayDetails()` procedure.
Q69[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A program is required to analyse weather data for a week. The program will read daily average temperatures from a text file, calculate the weekly average, and find the hottest day.
You will use the following global variables:
Identifier
Data Type
Description
`Temperatures`
ARRAY[0:6] OF REAL
Stores the average temperature for each day.
`DayNames`
ARRAY[0:6] OF STRING
Stores the names of the days, initialised as: `["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]`
**(a)** Write program code to declare the global arrays `Temperatures` and `DayNames`. `DayNames` should be initialised with the values provided.
Q70[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(ii) The linked list will be stored in an array of 10 `SongNode` records.
Declare the following global variables:
- `Playlist`: An array of 10 `SongNode` records.
- `StartPointer`: An integer to store the index of the first item in the list.
- `HeapStartPointer`: An integer to store the index of the first free node.
Q71[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(iii) A procedure `InitialiseList()` is needed to set up the free list. It links all the nodes together and sets the `StartPointer` to -1.
For example, `Playlist[0].Pointer` will be 1, `Playlist[1].Pointer` will be 2, and so on, until the last node, which will have a pointer of -1.
Write program code for the procedure `InitialiseList()`.
Q72[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(i) The following pseudocode describes a recursive procedure to display the playlist.
```pseudocode
PROCEDURE DisplayRecursive(CurrentNodePointer : INTEGER)
IF CurrentNodePointer <> -1 THEN
OUTPUT Playlist[CurrentNodePointer].SongTitle
DisplayRecursive(Playlist[CurrentNodePointer].Pointer)
ENDIF
ENDPROCEDURE
```
Write program code to implement the `DisplayRecursive` procedure.
Q73[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write the main program section to perform the following actions:
1. Call `ReadData()` to populate the `Temperatures` array.
2. Call `CalculateAverage()`, store the result in a suitable variable, and display it with a descriptive message.
3. Call `FindHottestDay()`, store the result in a suitable variable, and display it with a descriptive message.
Q74[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A program is needed to manage a digital art gallery. You will use object-oriented programming to model the artworks.
**(a)** The details for a base class `Artwork` are shown below:
Attribute
Data Type
Description
`Title`
STRING
The title of the artwork
`Artist`
STRING
The name of the artist
`Year`
INTEGER
The year the artwork was created
`IsDigital`
BOOLEAN
True if the artwork is digitally native
(i) Write program code to declare the class `Artwork` and its attributes.
If you are writing in Python, include attribute declarations as comments within the `__init__` method.
Q75[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The function `FindHottestDay()` takes no parameters. It finds the highest temperature in the `Temperatures` array and returns the name of the corresponding day from the `DayNames` array.
Write program code for the function `FindHottestDay()`.
Q76[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
(iii) The class has a public method `GetTitle()` which returns the artwork's title.
Write program code for the `GetTitle()` method.
Q77[6 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The procedure `ReadData()` reads temperatures from the text file `Temperatures.txt` and stores them in the `Temperatures` array. The file contains one temperature value per line. The procedure must handle the error if the file is not found, displaying a suitable error message.
Write program code for the procedure `ReadData()`.
Q78[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A new class, `Painting`, is required. It will inherit from the `Artwork` class.
A `Painting` has one additional attribute:
- `Medium` (STRING): The medium used, e.g., "Oil on canvas".
(i) Write the program code for the class declaration of `Painting`, showing that it inherits from `Artwork`.
Q79[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(ii) Write main program code to:
1. Call `InitialiseList()`.
2. Call `AddSong()` three times to add "Bohemian Rhapsody", "Stairway to Heaven", and "Hotel California" to the playlist.
3. Call `DisplayRecursive()` with the `StartPointer` to show the full playlist.
Q80[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
Test your program from part (c)(ii).
Provide a screenshot showing the output.
Q81[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The process of normalisation is used to improve the database design. Explain why the `Loan` table is not in Third Normal Form (3NF).
Q82[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(ii) Initial memory state:
Address 90: 8
Address 91: 5
Q83[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
Complete the following truth table for the expression in part (a).
Q84[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A digital artist uses hexadecimal colour codes. The colour code for a shade of blue is #1B.
(i) Convert the hexadecimal value 1B to denary. Show your working.
Q85[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
A school library uses a single database table, `Loan`, to store data about book loans.
`Loan(LoanID, BookID, BookTitle, DateBorrowed, MemberID, MemberName, MemberPostcode)`
Primary keys are not yet defined. The table contains redundant and inconsistent data.
(i) State what is meant by data redundancy.
Q86[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
Identify one field from the `Loan` table that would lead to data redundancy.
Q87[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Redesign the database into three tables in 3NF: `tblLoan`, `tblBook`, `tblMember`. For each table, list the field names and identify the primary key and any foreign keys.
Q88[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The computer is protected by both anti-virus software and a firewall. Explain how a firewall helps to protect the computer from unauthorised access.
Q89[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The company uses a Local Area Network (LAN) in the office and connects to its other branches using a Wide Area Network (WAN). Describe two differences between a LAN and a WAN.
Q90[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The TCP/IP protocol suite is used for all network communication. Explain the role of the IP protocol within this suite.
Q91[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Identify one other protocol that operates at the Application Layer of the TCP/IP model.
Q92[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
State the overall purpose of this assembly language program.
Q93[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A logic circuit is represented by the Boolean expression:
X = (A AND B) OR (NOT B AND C)
Draw the logic circuit for this expression.
Q94[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Using the normalised tables from part (c), write an SQL query to retrieve the `BookTitle` and `DateBorrowed` for all loans made by the member with `MemberName` 'John Smith'.
Q95[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A game developer is optimising code for a specific processor architecture. Understanding the role of registers is crucial.
Complete the table by describing the purpose of each register.
Q96[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Explain the 'Fetch' stage of the Fetch-Decode-Execute cycle. Your explanation must refer to the Program Counter (PC), Memory Address Register (MAR), and Memory Data Register (MDR).
Q97[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
One of the artist's images is 2048 pixels wide and 1536 pixels high, with a 24-bit colour depth. Calculate the file size of this uncompressed image in megabytes (MB).
Show your working.
Q98[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The student needs to be aware of security threats. Identify two types of malware and for each, describe its effect.
Q99[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
When a user types a web address like 'www.cambridge.org' into a browser, the Domain Name System (DNS) is used. Explain the function of DNS.
Q100[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Describe the function of the control bus.
Q101[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The following assembly language program is run on a processor. Refer to the instruction set in Appendix 1.
```assembly
START:
LDD 90
ADD 91
SUB 20
JPN NEGATIVE
STO 92
JMP ENDPROG
NEGATIVE:
LDI 0
STO 92
ENDPROG:
END
```
Trace the execution of this program using the given initial memory values. Complete the trace table for each execution.
(i) Initial memory state:
Address 90: 15
Address 91: 10
Q102[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A student uses a computer with a multi-tasking operating system (OS).
Describe the role of the OS in managing processor time in a multi-tasking environment.
Q103[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
The artist uses compression to reduce file sizes. Identify two differences between lossy and lossless compression.
Q104[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The artist records sound for a multimedia project. Explain how an analogue sound wave is converted into a digital format.
Q105[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A company is setting up a new office network. They have chosen a client-server model.
State two benefits of a client-server network compared to a peer-to-peer network for a company.
Q106[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
Convert the denary value 150 to an 8-bit binary number.
Q107[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Draw a logic circuit for the Boolean expression from part (a).
Q108[8 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
A main procedure, `MakeBooking()`, is needed to handle customer requests. The procedure will:
- Repeatedly ask the user to input the number of seats they want and their preferred row number.
- The loop terminates if the user enters 0 for the number of seats.
- Call the `FindConsecutiveSeats()` function with the user's input.
- If the function returns a valid starting column (not -1):
- It will update the `SeatingPlan` array, changing the 'E's to 'X's for the booked seats.
- It will output a confirmation message, for example: "Booking confirmed. Row: 5, Seats: 4 to 6"
- If the function returns -1, it will output a message like: "Sorry, no seats available in that row."
Write pseudocode for the `MakeBooking()` procedure.
Q109[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
(ii) Identify the foreign key in the `Screening` table and state the table it links to.
Q110[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
The cinema uses a computer system to process online snack orders. When an order is placed, it is added to a queue. The kitchen staff take orders from the front of the queue to prepare them.
(i) Describe one key feature of a queue abstract data type.
Q111[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A safety system in the cinema's projector room controls an alarm. The alarm, A, will be active (output 1) if:
- The projector lamp, L, is ON **AND** the fire sensor, F, is NOT activated.
- **OR**
- The emergency override switch, E, is ON.
L, F, and E are inputs. A is the output. A value of 1 represents ON/activated.
Write a Boolean expression for the alarm system, A.
Q112[8 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
The cinema needs a program to manage seat bookings for a screen. The screen's layout is stored in a 2D array:
`DECLARE SeatingPlan : ARRAY[1:15, 1:20] OF CHAR`
An element in the array stores either 'E' for an empty seat or 'X' for an occupied seat.
A function, `FindConsecutiveSeats()`, is required. This function will:
- Take the number of seats required (`NumSeats`) and the desired row number (`RowNum`) as parameters.
- Search the specified row for a block of `NumSeats` consecutive empty seats.
- Return the starting column number of the first available block found.
- If no such block of seats is found in the row, it will return -1.
For example, if `NumSeats` is 3 and Row 5 is `E, E, X, E, E, E, X...`, the function should return 4.
Write pseudocode for the `FindConsecutiveSeats()` function.
Q113[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A simple processor is used to perform a calculation. The processor has one general purpose register, the Accumulator (ACC).
The following table shows part of the processor's instruction set.
Opcode
Operand
Explanation
LDD `<address>`
Direct addressing
Load the contents of the given address into the ACC.
LDI `<address>`
Indirect addressing
The address to be used is at the given address. Load the contents of this second address into the ACC.
STO `<address>`
Direct addressing
Store the contents of the ACC at the given address.
ADD `<address>`
Direct addressing
Add the contents of the given address to the ACC.
SUB `<address>`
Direct addressing
Subtract the contents of the given address from the ACC.
END
Stop the program.
(i) Explain the term 'indirect addressing'.
Q114[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write a pseudocode function, `CountTickets()`, that traverses the linked list from a given start pointer and returns the number of tickets in the list.
Q115[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
(ii) An object is an instance of a class. The `Customer` class will have properties and methods. State one suitable property and one suitable method for the `Customer` class.
Q116[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
The cinema stores information about films and their screenings in a relational database. Two of the tables are `Film` and `Screening`.
`Film(FilmID, Title, Rating, Director)`
`Screening(ScreeningID, FilmID, ScreenNumber, StartTime)`
(i) Identify the primary key of the `Screening` table.
Q117[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write a DML script to show the `Title` of the film and its `StartTime` for all screenings in `ScreenNumber` 3.
Q118[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
(ii) Justify your choice of data type.
Q119[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The queue is implemented as a linear queue using a 1D array, `OrderQueue`, of size 6. The following pseudocode defines the variables used.
`DECLARE OrderQueue : ARRAY[0:5] OF STRING`
`DECLARE HeadPointer : INTEGER`
`DECLARE TailPointer : INTEGER`
`DECLARE NumberOfItems : INTEGER`
Initially, `HeadPointer` is 0, `TailPointer` is 0, and `NumberOfItems` is 0.
Complete the trace table below to show the state of the variables after each operation.
Operation
HeadPointer
TailPointer
NumberOfItems
Contents of OrderQueue[0] to [5]
Initial State
0
0
0
["", "", "", "", "", ""]
Enqueue("Popcorn")
Enqueue("Drink")
Dequeue()
Enqueue("Sweets")
Q120[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Explain the difference between a static data structure and a dynamic data structure. Use one example of each to support your explanation.
Q121[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A new ticket, 'T15', is added to the end of the list.
Update the diagram or the table from part (a) to show the state after 'T15' has been added.
Q122[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
The cinema's booking system is being upgraded using an object-oriented programming paradigm. A class `Customer` will be defined.
(i) State what is meant by a class.
Q123[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
(ii) Identify the name of the operation used to add an item to a queue and the operation used to remove an item from a queue.
Q124[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
The cinema stores the price of a ticket, for example, 9.50 or 12.00.
(i) State the most appropriate data type to store the ticket price.
Q125[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A customer's ticket purchases are stored in a linked list. Each node in the list stores a `TicketID` and a pointer to the next node.
The linked list is defined using the following user-defined type:
`TYPE TicketNode`
` DECLARE TicketID : STRING`
` DECLARE NextNode : INTEGER`
`ENDTYPE`
An array of records of type `TicketNode` is used to store the list:
`DECLARE TicketList : ARRAY[0:9] OF TicketNode`
The start pointer for the list is `StartPointer = 0`. The list of free nodes starts at `HeapStart = 4`.
The current state of the array is:
Index
TicketID
NextNode
0
"T01"
1
1
"T05"
2
2
"T12"
-1
3
4
5
5
6
6
7
7
8
8
9
9
-1
Draw a diagram of the linked list represented by the data.
Q126[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Complete the truth table for this logic system.
E
L
F
A
0
0
0
0
0
1
0
1
0
0
1
1
1
0
0
1
0
1
1
1
0
1
1
1
Q127[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The following program is in main memory. Complete the trace table to show the execution of the program. The initial value at memory address 103 is 20.
**Memory**
Address
Instruction
100
LDD 103
101
SUB 104
102
STO 105
103
20
104
5
105
0
**Trace Table**
Program Counter
Instruction Executed
Accumulator
Address 105
100
0
Q128[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
A 2D array called `SeatingPlan` is used to store the booking status of a cinema screen. An element can store either 'E' (for empty), 'B' (for booked), or 'R' (for reserved).
State the most appropriate data type for an element in this array.
Q129[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write a Data Manipulation Language (DML) script to show the `Title` and `Rating` for all films directed by 'Christopher Nolan'.
Q130[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Explain what is meant by encapsulation, using the `Customer` class as an example.
Q131[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(iv) A recursive function `CountSongs` is needed to count the number of songs in the playlist.
The function will:
- take the index of a node as a parameter
- return 0 if the index is -1 (the base case)
- otherwise, return 1 + the result of calling itself with the index of the next node (the recursive step).
Write program code for the recursive function `CountSongs`.
Q132[7 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
(ii) A procedure, `ReadData`, will read data from a text file named `RAINFALL.TXT`. Each line of the file contains one real number representing a rainfall measurement.
The procedure will:
- open and read from the file `RAINFALL.TXT`
- handle the error if the file is not found, and output a suitable message
- read each rainfall value from the file and store it in the `RainfallData` array
- update the `NumberOfReadings` variable to count how many values have been read.
Write program code for the `ReadData` procedure.
Q133[7 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
(v) The main part of the program orchestrates these subroutines.
Write program code for the main program to:
1. Call the `ReadData` procedure.
2. Check if any readings were successfully loaded (`NumberOfReadings > 0`).
3. If readings were loaded:
a. Call `CalculateTotal` and store the result.
b. Call `FindHighest` and store the result.
c. Calculate the average rainfall (`total / NumberOfReadings`).
d. Output the total, average, and highest rainfall, with appropriate text labels.
Q134[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A program is required to analyse rainfall data. The program will store up to 31 daily rainfall measurements.
(i) A 1D array, `RainfallData`, will be used to store the rainfall measurements, which are real numbers. An integer variable, `NumberOfReadings`, will store the count of measurements read from a file.
Write program code to declare the global array `RainfallData` and the global variable `NumberOfReadings`.
Use the identifiers given.
Q135[6 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(v) The main program will create objects of these classes.
Write program code to:
1. Declare an array or list named `MyMedia` to store the objects.
2. Create one `AudioFile` object with the following data:
- `FileName`: "track01.flac"
- `FileSize`: 34078720
- `Duration`: 240
- `BitRate`: 1120
3. Create one `VideoFile` object with the following data:
- `FileName`: "holiday.mp4"
- `FileSize`: 891289600
- `Duration`: 600
- `Resolution`: "1920x1080"
- `FrameRate`: 25.0
4. Add both objects to the `MyMedia` array/list.
5. Iterate through the `MyMedia` array/list and for each object, print its file name and its size in MB (by calling the `GetFileSizeMB()` method).
Q136[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(iv) A `VideoFile` is another type of `MediaFile`. The `VideoFile` class inherits from `MediaFile` and has two additional attributes.
**Class `VideoFile` inherits from `MediaFile`**
Attribute
Data Type
Description
`Resolution`
`STRING`
The resolution (e.g., "1920x1080").
`FrameRate`
`REAL`
The frames per second (e.g., 29.97).
Write program code to declare the class `VideoFile` and its constructor. The constructor will receive parameters for all `MediaFile` attributes plus the two new attributes. It must call the constructor of the base class.
Q137[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A music player application uses a linked list to manage a playlist. The linked list is implemented using an array of records.
A record type `SongNode` is used for each element in the linked list.
**Record `SongNode`**
Field
Data Type
Description
`SongTitle`
`STRING`
The title of the song.
`NextSong`
`INTEGER`
The array index of the next song in the playlist.
Write program code to declare the `SongNode` record/structure type.
Q138[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(v) Write main program code to test the subroutines.
The code should:
1. Call `InitialiseList`.
2. Call `AddSong` to add the following three songs in order: "Bohemian Rhapsody", "Stairway to Heaven", "Hotel California".
3. Call `CountSongs` with the `StartPointer` to get the total number of songs.
4. Output the returned count with a suitable message.
Q139[6 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(iii) A procedure `AddSong` is required to add a new song to the end of the playlist.
The procedure takes the new song's title as a parameter. It gets an empty node from the free list, stores the song title, and links it to the end of the current playlist.
Assume the list is not full.
Write program code for the `AddSong` procedure.
Q140[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(iii) An `AudioFile` is a type of `MediaFile`. The `AudioFile` class inherits from `MediaFile` and has one additional attribute.
**Class `AudioFile` inherits from `MediaFile`**
Attribute
Data Type
Description
`BitRate`
`INTEGER`
The bitrate in kbps (e.g., 320).
Write program code to declare the class `AudioFile` and its constructor. The constructor will receive parameters for all `MediaFile` attributes plus the `BitRate` attribute. It must call the constructor of the base class.
Q141[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(iv) A function, `FindHighest`, will find the highest rainfall measurement from the data stored.
The function will:
- assume there is at least one reading
- iterate through the `RainfallData` array
- find the highest value
- return the highest value.
Write program code for the `FindHighest` function.
Q142[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(i) The linked list will be implemented using a global array and pointers. The playlist can hold a maximum of 10 songs.
Write program code to declare:
- A 1D array named `Playlist` of size 10, with elements of type `SongNode`.
- An integer variable `StartPointer`.
- An integer variable `FreeListPointer`.
Q143[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(ii) A procedure `InitialiseList` is needed to set up the array and pointers for the linked list. The pseudocode for this procedure is shown in the Appendix.
Write program code to implement the `InitialiseList` procedure.
Q144[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
(vi) Test your program from part (f).
Provide a screenshot of the console output.
Q145[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(ii) The `MediaFile` class needs a method, `GetFileSizeMB()`, to return the file size in megabytes (MB).
`1 megabyte = 1024 * 1024 bytes`
The method should:
- calculate the file size in MB from the `FileSize` attribute
- round the result to two decimal places
- return the calculated value.
Write program code for the method `GetFileSizeMB()`.
Q146[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A program is being written to manage a collection of digital media files. A class `MediaFile` is required as a base class.
**Class `MediaFile`**
Attribute
Data Type
Description
`FileName`
`STRING`
The name of the file (e.g., 'song1.mp3')
`FileSize`
`INTEGER`
The size of the file in bytes.
`Duration`
`INTEGER`
The length of the media in seconds.
(i) Write program code to declare the class `MediaFile` and its constructor. The constructor initialises the attributes with values passed as parameters.
Do not declare any other methods.
Q147[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(iii) A function, `CalculateTotal`, will calculate the total rainfall from the measurements stored in the array.
The function will:
- iterate through the `RainfallData` array from the first element up to the number of readings stored
- sum the rainfall values
- return the calculated total.
Write program code for the `CalculateTotal` function.
Q148[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
(vi) Test your program from part (e).
Provide a screenshot of the console output.
Q149[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
(vi) Test your program.
Create a file `RAINFALL.TXT` with the following content:
4.5
8.0
0.5
12.2
3.1
Execute your program. Provide a screenshot of the output.
Q150[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
The artist uses lossy compression on the audio files before uploading them.
Identify two benefits of using lossy compression for this purpose.
Q151[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A school network administrator is responsible for maintaining the school's computers.
Describe the role of the operating system in managing the computer's memory.
Q152[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Describe two types of security threat to the school's computer systems.
Q153[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The artist also records short audio clips. Describe how an analogue sound wave is converted into a digital format.
Q154[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
Identify one piece of utility software, other than anti-virus software, the administrator might use.
Q155[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Explain what is meant by 'colour depth'.
Q156[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
Identify the single logic gate that is equivalent to the expression A NOR A.
Q157[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Identify two differences between simplex and duplex data transmission.
Q158[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A computer science student is learning about the Von Neumann architecture.
State two features of the Von Neumann architecture.
Q159[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A logic circuit is represented by the Boolean expression:
X = (A AND B) OR (NOT B AND C)
Draw the logic circuit for this expression.
Q160[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Describe the role of the Arithmetic and Logic Unit (ALU) in the fetch-decode-execute cycle.
Q161[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A processor uses the instruction set shown in Appendix 1.
Describe the addressing mode used in the instruction `LDX 100`.
Q162[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
The system represents a patient's age using an 8-bit two's complement integer.
State the denary range of numbers that can be represented.
Q163[8 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
Consider the following assembly language program:
```
LDI 0
STO 200
LDI 5
STO 201
LDD 200
ADD 201
STO 202
END
```
Trace the execution of this program. Complete the trace table to show the state of the registers and memory locations after each instruction is executed.
Q164[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A medical records system stores sensitive patient data.
Describe two principles of data protection legislation that the system's operators must follow.
Q165[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
An online gaming company relies on a fast and reliable network to connect players.
Explain the purpose of the TCP/IP protocol suite in network communication.
Q166[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The administrator needs to install new software. Explain the difference between a compiler and an interpreter.
Q167[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Explain the role of the VehicleID field in both the VEHICLE and RENTAL tables.
Q168[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The company's servers are protected by a firewall.
Describe two ways a firewall helps to secure the network.
Q169[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A digital artist creates images for a website. One image has a resolution of 800 pixels by 600 pixels and a colour depth of 24 bits.
Calculate the file size of this uncompressed image in kilobytes (KB). Show your working.
Q170[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Complete the table below by describing the purpose of each register.
Q171[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Another measurement in the system is stored using floating-point representation.
Explain why normalisation is used in floating-point representation.
Q172[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A car rental company uses a relational database to store details of its vehicles and rentals. Two of the tables are:
**VEHICLE** (VehicleID, Make, Model, Registration, DailyRate)
**RENTAL** (RentalID, StartDate, EndDate, VehicleID, CustomerID)
Write an SQL query to select the Make and Model for all vehicles with a DailyRate of less than 50.00.
Q173[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Describe the relationship between the VEHICLE table and the RENTAL table.
Q174[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
Identify one other type of database model, apart from relational.
Q175[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The system is upgraded. The alarm (X) will now sound if (the door is open (A) AND the time is after 9pm (B)) OR (a fire sensor is triggered (C)).
Write a logic expression and draw the corresponding logic circuit for the new system.
Q176[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
A simple alarm system is used at the library exit. The alarm (S) will sound if a sensor detects a person is at the exit (A) AND a second sensor detects they are carrying a book that has not been checked out (B).
Write a logic expression for the output S in terms of A and B.
Q177[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
A relational database stores data about books and loans. The two tables used are `Book` and `Loan`.
**Book**(`BookID`, `Title`, `Author`, `Genre`)
**Loan**(`LoanID`, `BookID`, `MemberID`, `DateDue`)
(i) Identify the primary key for the `Book` table.
Q178[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
The library system needs to store a list of overdue fines for each member. A 1D array called `Fines` is used for one member. Describe the characteristics of this array.
Q179[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write a Data Definition Language (DDL) script to create the `Book` table. Use appropriate data types for each field. The `BookID` should be the primary key.
Q180[8 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
The value 3 is initially stored at memory address 50. All other memory locations are 0.
Complete the trace table for the execution of the program.
PC
ACC
Address 50
Address 51
Jumps
200
3
0
Q181[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A text file, `MEMBERS.TXT`, stores member data. A procedure `AddMember()` is needed to add a new member's details to the end of this file. The procedure takes the new `MemberID`, `Name`, and `Postcode` as string parameters.
Write pseudocode for the procedure `AddMember()`.
Q182[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write a Data Manipulation Language (DML) script to show the `Title` and `DateDue` for all books written by 'Jane Smith'.
Q183[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
The library uses 8-bit two's complement to store certain values. Explain how a positive denary integer is converted into 8-bit two's complement binary.
Q184[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The following assembly language program is run. Refer to the instruction set in Table 1.
```assembly
200 LDD 0
201 STO 51
202 LDR 50
203 CMP #0
204 JPE 211
205 LDR 51
206 INC
207 STO 51
208 LDR 50
209 DEC
210 STO 50
211 JMP 202
212 END
```
Explain the purpose of this program, assuming a positive integer is initially stored at memory address 50.
Q185[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A text file, `LOANS.TXT`, contains loan data. Each line has the format: `BookID,MemberID,DueDate`. `DueDate` is a string in 'YYYYMMDD' format.
A procedure `GenerateOverdueReport` will read this file, identify overdue books, and write a report to a new file, `OVERDUE.TXT`.
Write a pseudocode function `IsOverdue` that takes two string parameters, `CurrentDate` and `DueDate`. The function should return `TRUE` if the `DueDate` is before the `CurrentDate`, and `FALSE` otherwise.
Q186[9 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
Write the main pseudocode procedure `GenerateOverdueReport`.
Your procedure should:
- Prompt for and input the current date as a string ('YYYYMMDD').
- Read each line from `LOANS.TXT`.
- For each loan, use the function `IsOverdue()` from part (b) to check if it is overdue.
- If a loan is overdue, you should write the `BookID` and `MemberID` to the file `OVERDUE.TXT` in the format: `BookID, MemberID`.
- You can assume `LOANS.TXT` is not empty.
Q187[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Show the 8-bit two's complement representation of the denary number -45.
Q188[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A book's unique identifier is stored as a hexadecimal value. Convert the hexadecimal value 2B into denary.
Q189[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
The library website needs to display text in multiple languages. Explain why Unicode is a more suitable character set than ASCII for this purpose.
Q190[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
(ii) Identify the primary key for the `Loan` table.
Q191[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
(iii) Identify the foreign key in the `Loan` table and state the table it links to.
Q192[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Draw the logic circuit corresponding to the expression from part (a).
Q193[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Complete the truth table for the logic expression from part (a).
A
B
S
0
0
0
1
1
0
1
1
Q194[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Explain one advantage and one disadvantage of using an array to store the list of fines.
Q195[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A stack is used to keep track of the last five books a member has viewed on the library website. Describe how `PUSH` and `POP` operations work for a stack.
Q196[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
When a `MemberID` is entered into the system, a check digit is used to verify it. Explain how a check digit can help detect data entry errors.
Q197[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
The library website displays a bitmap image of each book's cover. State two factors that affect the file size of a bitmap image.
Q198[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The library is creating audio book previews. These are stored as digital sound files. Explain the meaning of the terms 'sampling rate' and 'sampling resolution' in the context of sound digitisation.
Q199[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
The library needs a program to generate a report of overdue books. A record type `LoanRecord` is used to store data read from a file. The record needs to store the book title (string), member ID (integer), and the number of days the book is overdue (integer).
Write pseudocode to declare the `LoanRecord` type.
Q200[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Explain how the storage of a vector graphic image differs from that of a bitmap image.
Q201[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
An operating system uses memory management techniques to handle multiple running processes.
Contrast the use of paging with the use of segmentation. You should state two differences.
Q202[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The following assembly language program is run. An instruction set is provided.
`LDD <address>`: Load value from address
`STO <address>`: Store value to address
`ADD <address>`: Add value at address to Accumulator
`INP`: Input a value into Accumulator
`OUT`: Output the value in the Accumulator
`END`: Halt the program
```assembly
INP
STO 100
ADD 100
STO 101
ADD 100
OUT
END
```
Trace the execution of this program assuming the user inputs the value `5`. Show the value of the Accumulator and memory location 100 and 101 after each instruction is executed.
Q203[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The image has a resolution of 800 x 600 pixels and a colour depth of 24 bits.
Calculate the uncompressed file size in kilobytes (KB). Assume 1 KB = 1024 bytes. Show your working.
Q204[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Describe a scenario in computing where a queue would be the most appropriate data structure to use.
Q205[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Malware is a threat to computer systems. Explain one key difference between a computer virus and a worm.
Q206[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Describe the sequence of steps taken by a processor when an interrupt is detected during the Fetch-Decode-Execute cycle.
Q207[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Interrupts can cause the processor to temporarily stop its current task.
Give one example of a hardware interrupt and one example of a software interrupt.
Q208[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
An industrial freezer has a safety system. The alarm X sounds (X=1) based on the state of four sensors A, B, C and D. The system's behaviour is defined in the truth table in **Table 2.1**.
Complete the following Karnaugh map (K-map) for the output X.
Q209[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write an SQL query to list the names of all students (`StudentName`) who are enrolled in the 'Computer Science' course.
Q210[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A stack and a queue are two common linear data structures.
State the principle for adding and removing items for a stack and for a queue.
Q211[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Draw loops on your K-map from part (a) to group the 1s. Each group should be as large as possible.
Q212[8 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
A text file, `SensorData.txt`, contains temperature readings. Each line of the file contains a sensor ID and a temperature value, separated by a comma. For example: `"SN01,22.5"`.
Write a pseudocode procedure, `AnalyseTemperatures()`, that takes a threshold value as a parameter. The procedure should:
- Open the file `SensorData.txt`.
- Read each line from the file until the end is reached.
- For each line, extract the temperature value.
- Count how many temperature readings are greater than the `Threshold` parameter.
- Display the final count on the screen.
- Close the file.
Q213[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A real number is stored using a 16-bit floating-point representation with a 10-bit mantissa and a 6-bit exponent. Both mantissa and exponent are in two's complement form. The mantissa is normalised.
Convert the denary number +53.25 into a 16-bit floating-point number in this format. Show your working.
(i) Convert +53.25 to binary.
Q214[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Using the same instruction set, write an assembly language program that inputs two numbers, adds them together, and outputs the result.
Q215[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A bank uses asymmetric encryption to secure data sent from a user's web browser to its server.
Explain how a public key and a private key are used in this process to ensure confidentiality of the data.
Q216[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(iii) Determine the final 16-bit representation. Show your working for the exponent.
Q217[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A user sends an email with a large file attachment to a colleague. This process uses the TCP/IP protocol suite.
Explain the function of the Transport layer in this process.
Q218[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
(ii) Normalise the binary number from part (i).
Q219[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Write the simplified sum-of-products expression for X from your loops.
Q220[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A college database uses the three tables shown in **Table 4.1**.
Identify the primary key for the `Enrolment` table, and the foreign keys present in the `Enrolment` table.
Q221[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Explain why virtual memory might be used by the operating system.
Q222[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A program uses a 1D array to implement a stack. The array is declared as `StackArray : ARRAY[0:4] OF INTEGER`. A variable `StackPointer` stores the index of the top element and is initialised to -1.
Write pseudocode for a procedure `Push(DataItem : INTEGER)` that adds an integer to the stack. The procedure should include a check to prevent adding an item to a full stack.
Q223[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Explain the function of the Application layer in this process.
Q224[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A digital photograph is stored as a bitmap image file.
State two items of metadata that would typically be stored within the image file, apart from the pixel data itself.
Q225[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
Test your complete program. Take a screenshot of the output. The file `WEATHER.TXT` is available.
Q226[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
Test your main program from part **(f)**. Take a screenshot of the output.
Q227[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A procedure, `DisplayQueue`, is needed to traverse the linked list from the `StartPointer` and output the `OrderID` and `CustomerName` for each order in the queue.
Write program code for the `DisplayQueue` procedure.
Q228[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write program code for the constructor of the `Book` class. The constructor takes the title, item ID, author, and ISBN as parameters.
It should call the constructor of the parent class to initialise the inherited attributes.
Q229[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
Write program code for the main program section to:
1. Call `InitialiseList()`.
2. Call `InsertOrder()` with OrderID `101` and CustomerName `"Alice"`.
3. Call `InsertOrder()` with OrderID `102` and CustomerName `"Bob"`.
4. Call `DisplayQueue()`.
Test your program. Take a screenshot of the output.
Q230[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A procedure, `InitialiseList`, is needed to set up the free list.
This procedure will:
- Set `StartPointer` to -1.
- Set `FreeListPtr` to 0.
- Loop through the `OrderQueue` array from index 0 to 8.
- In each iteration, set the `NextNode` pointer of the current node to point to the next node (i.e., `OrderQueue[i].NextNode = i + 1`).
- Set the `NextNode` pointer of the final node (at index 9) to -1.
Write program code for the `InitialiseList` procedure.
Q231[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The `Book` class has a method `DisplayDetails()` that outputs all the details of a book. This includes all attributes from both the `Book` and `LibraryItem` classes.
Write program code for the `DisplayDetails()` method.
Q232[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write program code for the main program section to:
1. Call the `ReadData` procedure.
2. If `DayCount` is greater than 0:
a. Call the `CalculateAverage` function, passing the `Temperatures` array and `DayCount` as arguments.
b. Store the returned value in a suitable local variable.
c. Display the average temperature with a suitable message, formatted to one decimal place.
3. If `DayCount` is 0, display a message indicating no data was processed.
Q233[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The `LibraryItem` class has several methods.
**(i)**
Write program code for a method `GetItemID()` which returns the `ItemID`.
**(ii)**
Write program code for a method `SetOnLoan()` which sets the value of the `OnLoan` attribute to `True`.
Q234[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A program is needed to analyse temperature data for a 30-day period. The data is stored in a text file.
**(i)**
Declare a global one-dimensional array, `Temperatures`, to store 30 real numbers.
**(ii)**
Declare a global integer variable, `DayCount`, to store the number of valid temperature readings.
Q235[7 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
A procedure, `ReadData`, will read the temperatures from the text file `WEATHER.TXT` into the `Temperatures` array.
The procedure must:
- Open the file `WEATHER.TXT`.
- Read each line from the file, convert it to a real number, and store it in the `Temperatures` array.
- Keep a count of the number of temperatures read and store this in the global variable `DayCount`.
- Close the file.
- Include exception handling for a `File not found` error. If the file is not found, an appropriate message should be displayed.
Write program code for the `ReadData` procedure.
Q236[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A function, `CalculateAverage`, will calculate and return the average temperature.
The function must:
- Take the `Temperatures` array and the `DayCount` as parameters.
- Iterate through the array up to `DayCount` to calculate the total sum of temperatures.
- Return the average temperature (Total / `DayCount`).
- The function should not return a value if `DayCount` is 0.
Write program code for the `CalculateAverage` function.
Q237[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
**(i)**
A function, `CountHotDays`, is needed. This function will:
- Take a real number, `Threshold`, as a parameter.
- Count how many days in the `Temperatures` array have a temperature greater than `Threshold`.
- Return this count.
Write program code for the `CountHotDays` function.
**(ii)**
Add code to your main program to call `CountHotDays` with a threshold of 20.0 and display the result with a suitable message.
Q238[6 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A digital library system uses object-oriented programming to model its items. The base class for all items is `LibraryItem`.
**Class `LibraryItem`**
Attribute
Data Type
Description
`Title`
STRING
The title of the item.
`ItemID`
STRING
A unique identifier, e.g., "LIB-001".
`OnLoan`
BOOLEAN
True if the item is currently on loan.
`DueDate`
DATE
The date the item is due back.
**(i)**
Write program code to declare the class `LibraryItem`.
**(ii)**
Write program code for the constructor of the `LibraryItem` class. The constructor takes the title and item ID as parameters. It should initialise `Title` and `ItemID` with the parameter values, `OnLoan` to `False`, and `DueDate` to a null or default date value (e.g., 01/01/1900).
*If you are writing in Python, include attribute declarations using comments.*
Q239[7 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
Write main program code to perform the following actions:
1. Create an instance of the `Book` class for a book titled "The Hitchhiker's Guide", with item ID "BK-4242", author "Douglas Adams", and ISBN "978-0345391803". Store this object in a variable named `MyBook`.
2. Call the `SetOnLoan()` method on the `MyBook` object.
3. Call the `DisplayDetails()` method on the `MyBook` object.
Q240[8 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
A procedure, `InsertOrder`, adds a new order to the end of the linked list. The procedure takes the `OrderID` and `CustomerName` as parameters.
Study the following pseudocode algorithm:
```pseudocode
PROCEDURE InsertOrder(NewOrderID : INTEGER, NewCustomerName : STRING)
IF FreeListPtr = -1 THEN
OUTPUT "Error: Queue is full."
ELSE
// Get a new node from the free list
NewNodeIndex = FreeListPtr
FreeListPtr = OrderQueue[NewNodeIndex].NextNode
// Populate the new node
OrderQueue[NewNodeIndex].OrderID = NewOrderID
OrderQueue[NewNodeIndex].CustomerName = NewCustomerName
OrderQueue[NewNodeIndex].NextNode = -1
// Find the end of the list and insert the new node
IF StartPointer = -1 THEN
StartPointer = NewNodeIndex
ELSE
CurrentNodeIndex = StartPointer
WHILE OrderQueue[CurrentNodeIndex].NextNode <> -1
CurrentNodeIndex = OrderQueue[CurrentNodeIndex].NextNode
ENDWHILE
OrderQueue[CurrentNodeIndex].NextNode = NewNodeIndex
ENDIF
ENDIF
ENDPROCEDURE
```
Write program code to implement the `InsertOrder` procedure.
Q241[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A program uses a static linked list to store a queue of customer orders. The linked list is implemented using an array of records.
The record structure, `OrderNode`, is defined as:
- `OrderID` (INTEGER)
- `CustomerName` (STRING)
- `NextNode` (INTEGER) - a pointer to the next node in the list.
**(i)**
Write program code to declare the `OrderNode` type or structure.
**(ii)**
Declare a one-dimensional array, `OrderQueue`, of size 10 to store `OrderNode` records.
**(iii)**
Declare the integer pointers `StartPointer` and `FreeListPtr` and initialise them to -1 (representing a null pointer).
Q242[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
The `Book` class is a specialised type of `LibraryItem`. It inherits from `LibraryItem` and has two additional attributes:
- `Author` (STRING)
- `ISBN` (STRING)
Write program code to declare the `Book` class. It must show that it inherits from the `LibraryItem` class.
Q243[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
The university uses the TCP/IP protocol suite for network communication. Describe the purpose of an IP address.
Q244[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
A university has a computer network that covers its single campus, connecting all lecture halls, libraries, and offices.
(i) Identify the most appropriate type of network for the university campus.
Q245[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
An e-commerce website uses HTTPS to secure communication with its customers' web browsers.
(i) Identify the type of security certificate that is essential for HTTPS to work.
Q246[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Data normalisation is used when designing a database. Describe the purpose of database normalisation.
Q247[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Describe two differences between a LAN and a WAN.
Q248[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Complete the following table to describe the purpose of each register.
Q249[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Describe two distinct methods, other than using strong passwords, that the website could use to protect customer accounts from unauthorised access.
Q250[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Describe the overall purpose of this short program.
Q251[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A library uses a relational database to manage its books and members. The tables are `MEMBER`, `BOOK`, and `LOAN`.
The relationship between `MEMBER` and `LOAN` is one-to-many. Explain what this means in the context of the library.
Q252[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
The designer also works with sound files. Explain the effect of increasing the sampling rate when recording a digital sound.
Q253[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
A student is writing a program in a high-level language to store and process student test scores, which are whole numbers between 0 and 100.
(i) Identify the most appropriate data type for a variable that will store a single test score.
Q254[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The `BOOK` table has fields: `BookID` (Primary Key), `Title`, `Author`, `Genre`. The `LOAN` table has fields: `LoanID` (Primary Key), `BookID` (Foreign Key), `MemberID` (Foreign Key), `DateBorrowed`. Write an SQL query to find the `Title` and `Author` of all books with the `Genre` 'Science Fiction'.
Q255[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Draw a logic circuit diagram for the Boolean expression from part (a).
Q256[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
(ii) The student wants to store the scores for a class of 30 students. Identify a suitable data structure to store all 30 scores.
Q257[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Describe what is meant by a high-level programming language.
Q258[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
A security light has three sensors, A, B, and C. The light (X) will switch on (X=1) if sensor A is activated AND sensor B is NOT activated, OR if sensor B is activated AND sensor C is activated.
Write a Boolean expression for this logic statement.
Q259[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A small business is purchasing new computers. The computers come with an operating system pre-installed.
Describe two functions of an operating system, other than providing a user interface.
Q260[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The business needs software for its accounting department. It can choose between off-the-shelf software and custom-written (bespoke) software. Explain two benefits of choosing off-the-shelf software.
Q261[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
(ii) Explain the term 'colour depth'.
Q262[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The designer needs to reduce the image file size. Describe the difference between lossy and lossless compression.
Q263[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
When a new member registers, their date of birth is entered. Describe two different validation checks that could be performed on the date of birth field.
Q264[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
(ii) HTTPS uses both symmetric and asymmetric encryption. Explain why both types of encryption are used.
Q265[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Identify two ethical issues related to the collection and use of customer data by the e-commerce website.
Q266[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The student's source code must be translated into machine code before the processor can execute it. Explain the difference between a compiler and an interpreter.
Q267[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A graphic designer is creating a bitmap image for a website.
(i) The image has dimensions of 800 pixels by 600 pixels and uses a 16-bit colour depth. Calculate the file size of this uncompressed image in kilobytes (KiB). Show your working.
Q268[8 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
A program is loaded into memory starting at address 200. The processor and memory are in the initial state shown in the Appendix.
```
200: LDD 205
201: ADD 206
202: STO 207
203: END
```
Trace the execution of this program. Complete the trace table below to show the value in each register after each instruction is executed. You do not need to show the value of the status register.
Q269[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
(ii) The university requires access to the global internet. Identify the type of network that the internet is an example of.
Q270[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A security light system has a light (L) that turns on (L=1) if a motion sensor (M) detects movement AND it is dark, as detected by a light sensor (D).
Inputs:
M = 1 if motion is detected, 0 otherwise.
D = 1 if it is dark, 0 otherwise.
Write the logic expression for the output L.
Q271[7 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
The following assembly language program is loaded into memory. Complete the trace table for the execution of this program.
Address
Instruction
100
INP
101
STO 200
102
INP
103
ADD 200
104
STO 201
105
OUT
106
HLT
Trace the program using the following inputs: 15, 7
PC
ACC
IX
Address 200
Address 201
Output
100
Q272[6 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A procedure `SearchAndDisplay` is needed. This procedure will:
- take an event name as a parameter
- search through the `ClubMembers` array
- output the name and personal best time for every athlete who competes in that event.
Write pseudocode for the `SearchAndDisplay` procedure.
Q273[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A program stores user login attempts in a file called `LOG.TXT`.
Explain the difference between opening a file in APPEND mode and opening a file in WRITE mode.
Q274[6 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Another file, `USERDATA.TXT`, stores a username on each line. Write a pseudocode algorithm that will:
1. Open the file `USERDATA.TXT`.
2. Read each username from the file.
3. Output each username to the screen.
4. Close the file after all usernames have been read.
Q275[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write a pseudocode function, `CountFreeSeats`, that will iterate through the `Seating` array and return the total number of free seats (seats with a value of 0).
Q276[8 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
Write a pseudocode procedure, `BookSeat`. This procedure must:
- Prompt the user to enter a row number and a seat number.
- Validate that the row is between 1 and 10 and the seat is between 1 and 8.
- Check if the chosen seat is free (has a value of 0).
- If the row/seat is invalid or the seat is already booked, it should display an appropriate error message and prompt the user again.
- The procedure should repeat this process until a valid, free seat is entered.
- Once a valid, free seat is entered, the procedure should update the `Seating` array to mark it as booked (set to 1) and output a confirmation message.
Q277[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A stack is used to reverse a list of characters. The characters P, R, O, G are pushed onto an empty stack in that order.
Show the contents of the stack after all characters have been pushed, and identify which character is at the top.
Q278[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Complete the truth table for the logic expression X = (A AND B) OR (NOT B).
Q279[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A school running club needs to store data about its members. For each member, the club stores their name, main event (e.g., '100m', 'Javelin'), and their personal best time in seconds.
Write pseudocode to declare a composite data type called `AthleteType` to store this data.
Q280[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A small cinema uses a 2D array, `Seating[1:10, 1:8]`, to manage bookings. A value of 0 indicates a free seat, and a value of 1 indicates a booked seat.
Write a pseudocode procedure, `InitialiseSeating`, that will set all elements in the `Seating` array to 0.
Q281[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The system also has an alarm (A) that sounds (A=1) if the motion sensor (M) detects movement OR a window sensor (W) is triggered.
Inputs:
M = 1 if motion is detected, 0 otherwise.
W = 1 if window is triggered, 0 otherwise.
Draw the logic circuit for the output A.
Q282[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A vet clinic uses a relational database to store data about clients and their pets. The two main tables are CLIENT and PET.
CLIENT (ClientID, FirstName, LastName, Telephone)
PET (PetID, PetName, PetType, DOB, ClientID)
(i) Identify the primary key for the CLIENT table.
(ii) Identify the primary key for the PET table.
Q283[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Explain two differences between the ASCII and Unicode character sets.
Q284[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
The club has a maximum of 100 members. Write a pseudocode statement to declare a suitable data structure to store the data for all members.
Q285[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
The assembly language instruction set in the Appendix uses different modes of addressing.
Explain the difference between direct addressing and immediate addressing. Use examples from the instruction set.
Q286[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write a Data Manipulation Language (DML) script to show the pet name and pet type for all pets that are dogs.
Q287[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A stack is an Abstract Data Type (ADT).
Describe the key properties of a stack.
Q288[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A music player uses a queue to manage a playlist of songs.
Name and describe the two main operations associated with a queue.
Q289[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
A hexadecimal colour code is #4B82E1. Convert the green component, 82, into a denary number.
Q290[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Describe how a bitmap image is stored by a computer.
Q291[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A computer system stores the denary integer 179 as an 8-bit binary number.
Show the 8-bit binary representation of 179.
Q292[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Write a DML script to add a new client to the database: 'Anika', 'Sharma', '07700900123'. The next available ClientID is 104.
Q293[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Explain what is meant by a foreign key, using an example from the tables provided.
Q294[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
A computer is running a program when a hardware device requires the processor's attention.
Define the term 'interrupt'.
Q295[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Compare Paging and Segmentation by stating one advantage of Paging and one advantage of Segmentation.
Q296[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Explain the main problem with using only symmetric encryption to establish a secure online banking session.
Q297[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
The photographer decides to use lossy compression to reduce the file size of the bitmap image.
Describe one technique that could be used for lossy compression of an image.
Q298[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A user connects to their online bank. The connection is secured using encryption.
Describe how symmetric encryption works to secure the data transmitted during the session.
Q299[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A user sends an email with a large file attachment to a colleague. The TCP/IP protocol suite is used to transmit the data.
Describe the role of the Transport Layer in this process.
Q300[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A real number is stored in a computer using a 12-bit floating-point representation, with 8 bits for the mantissa and 4 bits for the exponent. Both the mantissa and the exponent are in two's complement format.
Convert the denary value +6.75 into this floating-point format. Show your working.
Q301[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
An operating system uses memory management to allow multiple programs to run concurrently.
Describe the memory management technique of Paging.
Q302[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Describe the sequence of steps the processor takes to handle an interrupt during the fetch-execute cycle.
Q303[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Explain the difference between direct addressing and indexed addressing, using an example for each from the instruction set.
Q304[8 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
A flight booking system processes requests stored in a queue. Each request is a string containing a flight number. A 2D array, `FlightData[100, 2]`, stores details for up to 100 flights. Column 1 stores the flight number (string) and Column 2 stores the number of available seats (integer).
A procedure `InitialiseQueue()` enqueues five booking requests: "BA123", "LH456", "BA123", "AF789", "BA123".
Write a pseudocode function, `ProcessBookings()`, which takes the queue of booking requests as a parameter. The function processes each request from the queue. For each request, it searches the `FlightData` array. If the flight is found and has seats available, it decrements the seat count in the array and increments a success counter. The function returns the final count of successful bookings.
Assume the `FlightData` array has been populated.
Q305[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Explain the purpose of a primary key in a database table. Identify the most suitable field to be the primary key for the `Employee` table.
Q306[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Describe the memory management technique of Segmentation.
Q307[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
Refer to the assembly language instruction set in the Appendix.
A programmer wants to multiply the number in the Accumulator (ACC) by 4. This can be done by adding the number to itself twice.
The following assembly language program has been written to do this. It is incomplete.
Address
Instruction
Operand
100
101
STO 200
102
ADD 200
103
ADD 200
104
END
Complete line 100 to load the value 12 into the ACC.
Q308[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Write the simplified sum-of-products expression for V from your looped K-map.
Q309[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
The business wants to give a 5% pay rise to all employees in the 'Sales' department.
Write an SQL statement to update the records.
Q310[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Draw loops on your completed K-map to group the 1s. Each group should be as large as possible.
Q311[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A database for a small business stores employee data in a table named `Employee`.
`Employee`(`EmployeeID`, `FirstName`, `LastName`, `Department`, `Salary`)
Write an SQL query to display the `LastName` and `Department` for all employees with a `Salary` greater than 50000.
Q312[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
A greenhouse climate control system has four sensors: Temperature (T), Humidity (H), Light (L), and Carbon Dioxide (C). A ventilation fan (V) is switched on (V=1) based on the sensor inputs. The system is described by the Boolean expression:
V = (T AND H AND NOT L) OR (T AND NOT H AND NOT L) OR (T AND H AND L) OR (NOT T AND H AND L) OR (T AND NOT H AND L)
Complete the following Karnaugh Map (K-map) for the output V.
Q313[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Asymmetric encryption is used to solve this problem.
Describe how the bank's public key is used to allow the user's browser to securely send a symmetric session key to the bank.
Q314[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Trace the execution of the completed program. Show the final value in the Accumulator and in memory location 200.
Q315[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The photographer also creates logos using vector graphics.
Explain how a vector graphic stores an image and state two benefits of using vector graphics compared to bitmap graphics.
Q316[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A photographer captures a digital image with dimensions 4000 pixels wide by 3000 pixels high. The image is stored with a 24-bit colour depth.
Calculate the uncompressed file size of this image in Megabytes (MB). You should assume 1 MB = 2^20 bytes.
Show your working.
Q317[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Give two examples of events that could generate an interrupt, other than a key press on a keyboard.
Q318[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Explain the effect on the range and precision of the numbers that can be represented if one bit is moved from the exponent to the mantissa.
Q319[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Describe the role of the Network Layer (also known as the Internet Layer) in this process.
Q320[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
State the name of one other layer in the four-layer TCP/IP model.
Q321[6 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A new class, `EBook`, is required. An `EBook` is a type of `MediaItem`.
**Class `EBook`** (inherits from `MediaItem`)
Attribute
Data Type
Description
`Format`
STRING
The file format (e.g., "PDF", "EPUB").
`PageCount`
INTEGER
The number of pages in the e-book.
Write program code to declare the class `EBook` that inherits from `MediaItem`. Include its constructor, which should receive parameters for all `MediaItem` and `EBook` attributes and initialise them. The constructor must call the base class constructor.
Q322[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
The `MediaItem` class needs methods to access its attribute values.
Write program code for the following methods:
- `GetTitle()` which returns the `Title`.
- `IsOnLoan()` which returns the value of `OnLoan`.
Q323[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A new function, `CountHotDays()`, is required. This function takes a REAL value, `Threshold`, as a parameter. It counts and returns the number of days where the temperature in `TemperatureData` was strictly greater than `Threshold`.
Write program code for the `CountHotDays()` function.
Q324[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The function `FindHighest()` will find the highest temperature recorded.
It will:
- iterate through the valid data in the `TemperatureData` array.
- find the highest value.
- return the highest value.
Write program code for the `FindHighest()` function.
Q325[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write the main program section to:
1. Call `ReadTemperatureData()` with the filename `"Temperatures.txt"`.
2. If data was successfully loaded (`DataCount` > 0), then:
a. Call `CalculateAverage()` and store the result.
b. Call `FindHighest()` and store the result.
c. Output the average and highest temperatures with suitable explanatory text.
Q326[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A digital media library uses a program to catalogue its items. You will create a class `MediaItem` to represent a generic item.
**Class `MediaItem`**
Attribute
Data Type
Description
`ItemID`
STRING
Unique identifier for the item.
`Title`
STRING
The title of the item.
`Year`
INTEGER
The year the item was published.
`OnLoan`
BOOLEAN
True if the item is currently on loan.
Write program code to declare the class `MediaItem` and its constructor. The constructor will receive parameters to initialise all four attributes.
If you are writing in Python, include attribute declarations as comments.
Q327[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The function `CalculateAverage()` will calculate the average temperature.
It will:
- iterate through the valid data in the `TemperatureData` array (up to `DataCount`).
- calculate the sum of the temperatures.
- return the average temperature.
Write program code for the `CalculateAverage()` function.
Q328[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write a procedure `DisplayPlaylist()` that traverses the linked list from the beginning and outputs the title, artist, and duration for each song on a new line. The output for each song should be clearly formatted.
Q329[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A music player application uses a linked list to manage a playlist of songs. Each song is a node in the list.
The following data types and variables are used:
- A record/structure type `SongNode` with the following fields:
- `SongTitle`: STRING
- `Artist`: STRING
- `Duration`: INTEGER (in seconds)
- `NextNode`: POINTER TO `SongNode`
- A global pointer variable `StartPointer` of type POINTER TO `SongNode`, used to store the address of the first node in the list.
Write program code to declare:
(i) the `SongNode` type.
(ii) the global pointer `StartPointer`.
Q330[5 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write a function `FindSong()` that takes a song title as a string parameter. The function will search the linked list for the given title.
- If the song is found, the function returns the artist of that song.
- If the song is not found after searching the entire list, the function returns the string "Not Found".
Q331[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
A weather station records the maximum daily temperature in degrees Celsius for 30 days. This data is stored in a text file. A program is required to read and process this data.
The following identifiers will be used:
Identifier
Data Type
Description
`TemperatureData`
ARRAY[0:29] OF REAL
An array to store the 30 temperature readings.
`DataCount`
INTEGER
Stores the number of data items read from the file.
(i) Write program code to declare the global array `TemperatureData`.
(ii) Write program code to declare the global variable `DataCount` and initialise it to 0.
Q332[7 marks]hardCh1 · Information representation and multimedia· Information representation and multimedia
The procedure `AddSong()` adds a new song to the end of the playlist. It takes the song's title, artist, and duration as parameters.
Study the following pseudocode algorithm:
```pseudocode
PROCEDURE AddSong(Title, Artist, Length)
DECLARE NewNode : POINTER TO SongNode
DECLARE CurrentPointer : POINTER TO SongNode
NewNode <- new SongNode
NewNode.SongTitle <- Title
NewNode.Artist <- Artist
NewNode.Duration <- Length
NewNode.NextNode <- NULL
IF StartPointer IS NULL THEN
StartPointer <- NewNode
ELSE
CurrentPointer <- StartPointer
WHILE CurrentPointer.NextNode IS NOT NULL
CurrentPointer <- CurrentPointer.NextNode
ENDWHILE
CurrentPointer.NextNode <- NewNode
ENDIF
ENDPROCEDURE
```
Write program code to implement the `AddSong()` procedure.
Q333[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
Test your program using the file `Temperatures.txt` from the Appendix.
Take a screenshot of the console output and paste it into your evidence document.
Q334[3 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The `MediaItem` class needs a method to display its details.
Write program code for the method `DisplayDetails()`. This method will output all four attributes to the console, with suitable labels.
Q335[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The `DisplayDetails()` method needs to be overridden in the `EBook` class to include the new attributes.
Write program code for the `DisplayDetails()` method in the `EBook` class. This method should first call the `DisplayDetails()` method from the base class (`MediaItem`) and then display the `Format` and `PageCount` attributes.
Q336[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Write a procedure `InitialiseList()` that sets the `StartPointer` to a null value, indicating that the list is empty.
Q337[2 marks]easyCh1 · Information representation and multimedia· Information representation and multimedia
Write main program code to:
1. Call `InitialiseList()`.
2. Call `AddSong()` to add the following three songs:
- "Bohemian Rhapsody", "Queen", 355
- "Stairway to Heaven", "Led Zeppelin", 482
- "Hotel California", "Eagles", 391
3. Call `DisplayPlaylist()`.
Q338[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
Test the program code you wrote in part (f).
Take a screenshot of the console output and paste it into your evidence document.
Q339[4 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
Write main program code to:
1. Instantiate a `MediaItem` object with the following data: `ItemID`: "MI001", `Title`: "The History of Computing", `Year`: 1998, `OnLoan`: false.
2. Instantiate an `EBook` object with the following data: `ItemID`: "EB001", `Title`: "Advanced Algorithms", `Year`: 2022, `OnLoan`: true, `Format`: "PDF", `PageCount`: 450.
3. Call the `DisplayDetails()` method for each object.
Q340[6 marks]mediumCh1 · Information representation and multimedia· Information representation and multimedia
The procedure `ReadTemperatureData()` takes the filename as a string parameter. It reads the temperatures from the text file line by line and stores them in the `TemperatureData` global array. The procedure should update the `DataCount` variable as data is read.
The procedure must handle the case where the file does not exist by outputting a suitable error message.
Write program code for the `ReadTemperatureData()` procedure.
Q341[1 mark]easyCh1 · Information representation and multimedia· Information representation and multimedia
Test the program code you wrote in part (f).
Take a screenshot of the console output and paste it into your evidence document.