Byte Points 0 / 37
System Rank Byte Novice

Topic 2.2.4: Data Rep & Ghost Topics

Scope, Records, ASCII/Unicode, Strings & Logic.

1 [5 Marks]
(a) What is 'scope'?
(b) Two advantages of Local variables?
Hint: Think about where a variable lives and dies. And does it use memory forever?
✅ Mark Scheme

(a) The part of the program where a variable is recognised / can be accessed.

(b) Memory efficiency (cleared when function ends) / Easier debugging (changes isolate to function).

Score:
2 [5 Marks]
Car Record: ID (Int), Make (Str), Price (Real).
(a) Define the Record value.
(b) Update Price of car at index 5 of array showroom to 12500.00.
✅ Mark Scheme
RECORD Car
    ID : Integer
    Make : String
    Price : Real
END RECORD

(b) showroom[5].Price = 12500.00

Score:
3 [3 Marks]
ASC("A")=65, ASC("B")=66.
Output of:
1. CHR(67)
2. ASC("D")
3. CHR(ASC("A") + 3)
✅ Mark Scheme
  • 1. C
  • 2. 68
  • 3. D (65+3=68)
Score:
4 [4 Marks]
phrase = "Computer Science"
Result of:
  • phrase.length
  • phrase.substring(0, 8)
  • phrase.left(3)
  • phrase.upper
✅ Mark Scheme
  • 16
  • "Computer"
  • "Com"
  • "COMPUTER SCIENCE"
Score:
5 [4 Marks]
(a) ASCII vs Unicode difference?
(b) Why Unicode despite size?
✅ Mark Scheme

(a) ASCII is 7/8 bits (limited characters). Unicode is 16/32 bits (huge character set).

(b) Unicode supports all world languages and emojis.

Score:
6 [2 Marks]
num = input("Num: ") total = num + 10 print(total)
(a) The Error?
(b) Fix first line.
✅ Mark Scheme

(a) Type mismatch (Cannot add String + Int).

(b) num = int(input("Num: "))

Score:
7 [4 Marks]
Truth Table: isCold AND timerActive.
F/F, F/T, T/F, T/T.
✅ Mark Scheme
  • False
  • False
  • False
  • True
Score:
8 [4 Marks]
State Value and Data Type:
  • 10 / 4
  • 10 DIV 4
✅ Mark Scheme

2.5 (Real/Float)

2 (Integer)

Score:
9 [4 Marks]
Data type for:
  • Number of pages
  • Price of fine
  • Is on loan?
  • ISBN (e.g. "978-X...")
✅ Mark Scheme
  • Integer
  • Real/Float
  • Boolean
  • String
Score:
10 [2 Marks]
Why use CONST VAT = 0.2 instead of a variable?
✅ Mark Scheme

Prevents accidental changes to the value / Easier to update safely.

Score: