CodeIEB
Theory Notes/🗄️ Topic 4: Data & Information Management, Solution Development/11.4.3
11.4.3Grade 11

Data Structures: Dates, Strings & Arrays

Moving beyond single variables — this subtopic introduces arrays, the first real 'data structure' of the syllabus.

Date/time handling — using built-in classes/methods provided by the programming language to input, validate, store and output dates and times correctly (rather than as plain strings).

String manipulation methods you should be comfortable with: isolating individual characters, comparing strings, counting characters, inserting, replacing, appending, and deleting characters within a string (see 11.4.8 for applied algorithms).

One-dimensional array
A single, ordered list of values of the same type, accessed by an index (position), e.g. int[] scores = {85, 72, 91};
Parallel arrays
Two or more separate arrays where corresponding index positions relate to the same real-world entity, e.g. names[i] and ages[i] both describe the same person i.
Array of objects
A single array where each element is itself a full object (e.g. a Learner object), bundling all related fields together per element instead of spreading them across parallel arrays.
ComparisonParallel arraysArray of objects
Data cohesionRelated data is spread across multiple separate arrays — easy to accidentally get out of syncRelated data for one entity is bundled together in a single object — much harder to desynchronise
OOP alignmentNot object-orientedReflects real OOP design and encapsulation
When preferredSimple scripts with limited related fieldsAny realistic program modelling real-world entities

Example

// Parallel arrays String[] names = {"Ana", "Ben"}; int[] ages = {17, 18}; // Array of objects (preferred in OOP) Learner[] learners = new Learner[2]; learners[0] = new Learner("Ana", 17); learners[1] = new Learner("Ben", 18);

Sorting, searching and array manipulation algorithms are covered in detail in 11.4.8.

💡 Exam Tip

Exam questions almost always prefer 'array of objects' as the recommended design over parallel arrays when modelling real entities — be ready to explain why (data stays together, reduces the risk of arrays becoming out of sync).