Data types, structures and algorithms Flashcards
(b). The name of a product is stored using characters from the computer’s character set. (i) Explain what is meant by the character set of a computer.
Normally equates to the symbols on a keyboard / digits / letters…
…that can be represented / interpreted / understood by a computer
May include control characters
ii) Explain how codes are used to represent a character set.
Each symbol has a (binary) code / number…
…which is unique.
Number of bits used for one character = 1 byte
Example code: ASCII / Unicode… …uses 8 bits /16 bits per character Use of more bits for extended character set
3(a). Using the denary number 89 as an example, explain the relationship between binary and hexadecimal representations.
–Split the binary number in groups of 4 –Change each into a single value/(Hexadecimal) digit
–Digits which are between 10 and 15 are given letters A to F
–In this example: 0101 = 5 and 1001 = 9/Therefore 89 = 59(hex)
(d). State why a programmer might choose to declare a variable as a floating point number.
The variable may need to store decimal numbers.
To store very large / small values.
When Asim opens this file on the text editor on his computer it looks as below.
squaree4squarec5
(ii) Explain why the text may not be displaying correctly.
□ Asim’s text editor may only support ASCII which doesn’t include characters for the chess piece [1]
□ Cannot recognize / understand the binary values of the two pieces [1]
Data structures may be described as static or dynamic.
(i) State the meaning of the term static.
Size is fixed when structure created / size cannot change during processing
ii) State one type of data structure that is always considered to be static.
array
iii) State the meaning of the term dynamic.
Size can change during processing
(iv) Give one disadvantage of using a dynamic data structure.
Storage required is unknown initially / more difficult to program