131 Variables and data types
Understand how to use data types and variables to store, manipulate, and represent data in software systems.
This module introduces how variables and data types are used in programming to store information, perform operations, and represent different forms of data such as text, numbers, and logic. Students explore how data is categorised, stored, and referenced in memory, emphasising naming conventions, primitive types, and safe usage practices.
Targets
In this topic, students learn to:
Identify and describe standard data types used in software engineering
Define and declare variables using appropriate naming and typing conventions
Apply and compare data types such as integer, real, Boolean, character, and string
Use constants effectively to avoid magic numbers and improve readability
Construct and use a simple data dictionary to document data attributes
Glossary
Variable
A named storage location in memory that holds a value which can be changed during program execution
Constant
A named value that does not change while the program runs
Data type
A classification that defines the kind of data a variable can hold (e.g. integer, string, Boolean)
Type casting
The process of converting a variable from one data type to another
Data dictionary
A table or document that describes variables, their types, usage, and validation rules in a program
Overview
Variables are fundamental building blocks of all software. They allow a program to store, retrieve, and manipulate data dynamically. By declaring variables with a type, developers inform the system what kind of data to expect and how much memory to reserve. Common types include integers for whole numbers, floats for decimal values, Booleans for true/false logic, and strings for text. Constants are fixed values that should not change, improving maintainability and reducing bugs.
This module also introduces students to a data dictionary, an essential tool for planning and documenting the use of variables in a system. You will build strong habits in safe and secure coding practices by clearly defining each variable’s type, purpose, and validation rules.
5. Recommended subpages for GitBook
Each of the following would be a subpage under 131:
131.1 Declaring and using variables Introduces naming rules, initialisation, reassignment, and Python examples.
131.2 Data types and type casting Explores Python data types, how data is stored, and when to cast types.
131.3 Constants and naming conventions Covers when and why to use constants, including examples of naming styles.
131.4 Designing a data dictionary Introduces the structure and purpose of data dictionaries with examples and templates.
Let me know if you'd like microlabs or worked examples for each subpage. I can also draft the content for any of the pages listed above.
Last updated
Was this helpful?