Records (AQA GCSE Computer Science) : Revision Note

James Woodhouse

Written by: James Woodhouse

Reviewed by: Lucy Kirkham

Updated on

Records

What is a record?

  • A record is a way to group together different types of data about one item

  • It is a custom structure , it stores multiple related fields all in one place

  • Unlike an array (which only stores one type of data), a record can store different types (like strings, numbers, and decimals) in the same structure

Examiner Tips and Tricks

  • Records in programming are a type of data structure used to group related data in your code

  • These are not the same as records in a database, which refer to a complete set of fields on a single entity in a table (row)

Example: A car record

RECORD Car
    make : String
    model : String
    reg : String
    price : Real
    noOfDoors : Integer
ENDRECORD
  • This record structure groups together all the information about one car

  • Each field has a name and a data type

DECLARE myCar : Car

myCar.make ← "Toyota"
myCar.model ← "Yaris"
myCar.reg ← "AB12 XYZ"
myCar.price ← 5995.99
myCar.noOfDoors ← 5
  • myCar is one instance of the Car record

  • You can access each field using dot notation (e.g. myCar.make)

You've read 0 of your 5 free revision notes this week

Sign up now. It’s free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

James Woodhouse

Author: James Woodhouse

Expertise: Computer Science Lead

James graduated from the University of Sunderland with a degree in ICT and Computing education. He has over 14 years of experience both teaching and leading in Computer Science, specialising in teaching GCSE and A-level. James has held various leadership roles, including Head of Computer Science and coordinator positions for Key Stage 3 and Key Stage 4. James has a keen interest in networking security and technologies aimed at preventing security breaches.

Lucy Kirkham

Reviewer: Lucy Kirkham

Expertise: Head of STEM

Lucy has been a passionate Maths teacher for over 12 years, teaching maths across the UK and abroad helping to engage, interest and develop confidence in the subject at all levels.Working as a Head of Department and then Director of Maths, Lucy has advised schools and academy trusts in both Scotland and the East Midlands, where her role was to support and coach teachers to improve Maths teaching for all.