WJEC A-Level Computer Science 601-5345-3
Hardware: Architecture, Memory and Storage
Networks and Data Transmission
Logic Gates and Boolean Algebra
Data Representation and Data Types
Data Structures
Organisation of Data: Files and Records
Database Systems
The Operating System
Algorithms and Programs
Principles of Programming
Systems Analysis
Software Engineering and Program Construction
Types of Software System
Practical Programming
Data Security and Integrity
Computing, Society and the Law
Advanced Data Structures and Logic
Recursion, Sorting and Searching
Programming Paradigms and Translators
System Design and Human-Computer Interaction
Software Engineering Tools and Professional Practice
Advanced Architecture and Assembly Language
Communication Networks and File Organisation
Number Representation and Floating Point
Databases and Distributed Systems
Operating System Management
Software Systems and Applications
Data Security, Cryptography and Attack
Data Structures
Arrays of records
- 3 things to know
- AS Unit 1
Overview
Array of records, how the record with a given membership number is found and how records meeting a condition are counted.
What you need to know
Answer each one before you reveal it.
In what way does an array of records resemble a file of records?
Why is a two-dimensional array a poor substitute for an array of records?
Questions from this subtopic
Each one with the model answer underneath.
- 1
What is an array of records?
Model answer
It is an array in which every element is a complete record, giving a table where each element is one entity and each field of the record is a column of that table.
- 2
How is a single field of one element of an array of records referred to?
Model answer
The array is indexed first and the field then named, as in members[3].surname.
- 3
Write pseudocode to output the surname of every member in an array of 100 member records.
Model answer
FOR i FROM 0 TO 99, OUTPUT members[i].surname, END FOR.
- 4
Describe how the record with a given membership number is found.
Model answer
A loop runs through the elements in use comparing the membership field with the target, stops and reports the index as soon as they match, and reports that it is absent if the loop finishes without a match.
- 5
How is a field of one record in the array updated?
Model answer
By assigning to that field of the indexed element, as in setting members[7].balance to members[7].balance − 5.
- 6
Describe how records meeting a condition are counted.
Model answer
A counter is set to zero and a loop tests the relevant field of every element in use, adding one to the counter each time the test succeeds.
Other ways to work this
The same content, four other ways.
What is inside Levo
Six ways to work the same material.
Every question in Data Structures, on a schedule.
Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.