Data types, structures and algorithms Flashcards

1
Q

(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.

A

Normally equates to the symbols on a keyboard / digits / letters…
…that can be represented / interpreted / understood by a computer
May include control characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

ii) Explain how codes are used to represent a character set.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

3(a). Using the denary number 89 as an example, explain the relationship between binary and hexadecimal representations.

A

–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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

(d). State why a programmer might choose to declare a variable as a floating point number.

A

The variable may need to store decimal numbers.
To store very large / small values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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.

A

□ 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]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Data structures may be described as static or dynamic.
(i) State the meaning of the term static.

A

Size is fixed when structure created / size cannot change during processing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

ii) State one type of data structure that is always considered to be static.

A

array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

iii) State the meaning of the term dynamic.

A

Size can change during processing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

(iv) Give one disadvantage of using a dynamic data structure.

A

Storage required is unknown initially / more difficult to program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly