Skip to content
Marlbridge

Flashcards · 9618 · A Level Topic 13

Data Representation (A Level) flashcards

14 cards on A Level Topic 13, subtopics 13.1 to 13.3. Pick a subtopic or study them all.

Study mode needs JavaScript. Every card is listed below, so you can still cover the answers and test yourself.

All 14 cards

For a quick read-through or printing. Cover the right-hand side to test yourself.

13.1 User-defined data types

What is a user-defined data type and why is it used?
A data type created by the programmer from the built-in types, to model the data of a particular problem more closely.
What is an enumerated data type? Give a 9618 pseudocode example.
A non-composite type whose values are a fixed ordered list of names. TYPE Season = (Spring, Summer, Autumn, Winter)
What is a pointer data type? Give a 9618 pseudocode example.
A type whose values are memory addresses. TYPE TIntPointer = ^INTEGER MyPtr^ refers to the value at the address MyPtr holds (dereferencing).
What is the difference between composite and non-composite data types?
Non-composite: defined without referring to another type (e.g. enumerated, pointer). Composite: built from other data types (e.g. record, set, class).
What is a set data type?
A composite type holding an unordered collection of values with no duplicates, supporting set operations such as union, intersection and membership.

13.2 File organisation and access

What are serial, sequential and random file organisation?
Serial: records stored in the order they were added. Sequential: records stored in order of a key field. Random: each record is stored at an address calculated from its key by a hashing algorithm.
What is the difference between sequential and direct access?
Sequential access reads records one after another from the start. Direct (random) access goes straight to a record’s location, using an index or a hashing algorithm.
What is a hashing collision and how can it be handled?
Two keys give the same address. The record can be stored in the next free position (searching forwards) or in a separate overflow area.
How do you write a record to a random file in 9618 pseudocode?
OPENFILE "Seats.dat" FOR RANDOM SEEK "Seats.dat", Position PUTRECORD "Seats.dat", NewRecord CLOSEFILE "Seats.dat" (GETRECORD reads one.)
Which file organisation suits a payroll run and which suits a booking system?
Payroll processes every record in order, so sequential suits it. A booking system needs one record found quickly, so random (direct access) suits it.

13.3 Floating-point numbers, representation and manipulation

What are the mantissa and exponent in floating-point representation?
The number is mantissa × 2^exponent. The mantissa holds the significant digits (precision); the exponent sets where the binary point goes (range). Both are in two’s complement.
What is the trade-off between mantissa and exponent size?
More bits for the mantissa give greater precision. More bits for the exponent give a greater range of values.
What does it mean for a floating-point number to be normalised?
The mantissa starts 01 (positive) or 10 (negative), so the first two bits differ. This gives the maximum precision for the bits available and a unique representation of each value.
Why can some numbers not be stored exactly in floating point?
Values such as 0.1 have no exact binary fraction, so they are rounded, giving rounding errors. Results too large give overflow; too small to represent give underflow.