← VCE Software Development U3O1

Records: fields with different data types

A data structure that groups related fields of different data types into one item describing one thing, e.g. a student's name (String), age (Integer) and enrolled (Boolean).

Understanding Records: fields with different data types in VCE Software Development U3O1

What it does: One record (s1) bundles a String, an Integer and a Boolean that all describe one student, Ava. Each Student record in the array is one row, and name, age and enrolled are the columns, so the array stores a whole table of students. A record groups related fields that can have different data types. An array is the structure that usually holds values of one data type. Each field is defined by its name and its data type, for example age: Integer. Enrolled is either true or false, so the Boolean data type is the best choice.

Common mistakes: A student's name is text, so the field must have the data type String, not Integer. It should be: name AS String. In a Python dictionary record, each field name is joined to its value with a colon, not an equals sign. It should be: student = {"name": "Ava",.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 98–113) and word search (Modules 72–113).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which best describes a record?
A structure that can only hold values that all share the same data typeA structure that groups related fields, which can have different data types, into one item
Matches
RECORD Student: name, age, enrolled
↓
The fields have no data types. Each field needs a name and a data type, such as name AS String and age AS Integer.
Applying
Meanings
Term
record
Meaning
A data structure that groups related fields of different data types into one item describing one thing, e.g. a student's name (String), age (Integer) and enrolled (Boolean).
Practice
RECORD Student
Testing
Gaps
name :
Check Answer
Spots
1RECORD Student
2 name AS Integer

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Blobfish' badge — Pressure Handler, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which best describes a record?
A. A structure that groups related fields, which can have different data types, into one item ✓
B. A structure that can only hold values that all share the same data type
A record groups related fields that can have different data types. An array is the structure that usually holds values of one data type.
2. A student record has the fields name, age and enrolled. Which set of data types fits best?
A. name: Integer, age: Boolean, enrolled: String
B. name: String, age: Integer, enrolled: Boolean ✓
Each field gets the data type that suits its value: text is a String, a whole number is an Integer and true/false is a Boolean.
3. In a data dictionary or record design, what does each field need?
A. Only a value, because the data type is never needed
B. A field name and a data type ✓
Each field is defined by its name and its data type, for example age: Integer.
4. How many things should one record describe?
A. One entity, such as a single student ✓
B. Several different entities mixed together, such as a student, a teacher and a product
Use one record per entity. Each record describes one thing, and its fields are the details about that thing.
5. You want to store 30 students, each with a name, age and enrolled status. What is the best structure?
A. An array of records, with one record per student ✓
B. One single record holding all 30 students' names in the name field
An array of records works like a table. Each record is a row and each field is a column.

Match the Pairs

RECORD Student: name AS String, age AS Integer, enrolled AS Boolean → Defines a record type with three fields, each with its own data type
students[2].name → Reads the name field from the third record in an array of records
One record describes one entity, so each field holds one fact about that same student → s1 <- Student("Ava", 16, True)
An array of records is like a table: each record is a row and each field is a column → students = [Student("Ava", 16, True), Student("Liam", 17, False)]
RECORD Student: name, age, enrolled → The fields have no data types. Each field needs a name and a data type, such as name AS String and age AS Integer.
Student("Ava", "sixteen", "yes") → The values do not match the field data types. age should be the Integer 16 and enrolled should be the Boolean True.

Key Term

record
A data structure that groups related fields of different data types into one item describing one thing, e.g. a student's name (String), age (Integer) and enrolled (Boolean).

Fill in the Blanks

1. Record Student name : String age : Integer
Hint: Type the data type used to store a student's name (text).
2. Record Student name : String age : Integer
Hint: Type the keyword that starts a definition grouping related fields into one item.
3. Record Student age : Integer enrolled : Boolean
Hint: Type the data type for a field that is only true or false.
4. students ← Array of Student, size 30 students[1].name ← "Ava"
Hint: Type the record type that each element of this array of records holds.
5. students[0].name ← "Ava" students[0].age ← 16 print students[0].age
Hint: Type the field name that was given a whole number in the line above.

Spot the Error

Question 1
A RECORD Student
B name AS Integer
C age AS Integer
D enrolled AS Boolean
E END RECORD
Line B — A student's name is text, so the field must have the data type String, not Integer. It should be: name AS String.
Question 2
A student = {"name" = "Ava",
B "age": 16,
C "enrolled": True}
Line A — In a Python dictionary record, each field name is joined to its value with a colon, not an equals sign. It should be: student = {"name": "Ava",
Question 3
A student = {}
B student["name"] = "Ava"
C student["age"] = "16"
D print(student["age"] + 1)
Line C — The age field should be an Integer, but the quotes make it a String. Then age + 1 would cause a type error. It should be: student["age"] = 16
Question 4
A p = {"name": "Rex", "age": 3}
B print(p[name])
C print(p["age"] + 1)
Line B — A field is accessed using its field name as a string in quotes. Without quotes, Python looks for a variable called name. It should be: print(p["name"])
Question 5
A table = {}
B r = {"name": "Zoe", "age": 15}
C table.append(r)
D print(len(table))
Line A — An array of records used as a table must be a list so rows can be added with append(). A dictionary has no append(). It should be: table = []

Student with a class code? Join your class →