SLIDE 1
CSZone.co.uk
Click to advance · Arrow keys also work
AQA 8525 · Section 3.2 · 3.2.1

Data
Types

Integer · Real · Boolean · Character · String · Casting

CSZoneAQA GCSE Computer Science 8525
Learning Objectives

By the end of this lesson you will be able to...

Name and describe each of the five AQA data types
Give appropriate examples of values for each data type
Explain the difference between integer and real number types
Describe type casting and why it is needed
The Five AQA Data Types

AQA 8525 — Data Types You Must Know

Data TypeDescriptionExamples
IntegerWhole numbers (positive, negative, zero)42, -7, 0, 100
RealNumbers with a decimal point3.14, -0.5, 9.99
BooleanTrue or False onlyTrue, False
CharacterA single character (letter, digit, symbol)'A', '7', '!'
StringA sequence of zero or more characters'Hello', '42abc'
Integer vs Real

Choosing the Right Number Type

INTEGER
Use when counting discrete items
No decimal point — whole numbers only
E.g. number of students, score, age
score ← 85
REAL
Use for continuous values requiring precision
Has a decimal point
E.g. temperature, price, weight
price ← 9.99
Boolean & String

Boolean Logic and Strings

BOOLEAN
Only two possible values: True or False. Used in conditions and comparisons.
loggedIn ← True
found ← False
IF score > 50 THEN
  pass ← True
STRING
Zero or more characters in quotes. Can contain letters, digits, spaces, and symbols.
name ← 'Ahmed'
empty ← ''
msg ← 'Score: 85'
Type Casting

Converting Between Data Types

Sometimes you need to convert a value from one type to another. AQA pseudocode uses built-in functions for this — called type casting.
FunctionConverts toExample
INT(x)IntegerINT('42') → 42
REAL(x)RealREAL(3) → 3.0
STR(x)StringSTR(85) → '85'
BOOL(x)BooleanBOOL(1) → True
Why casting?USERINPUT always returns a string. Use INT() to do arithmetic: age ← INT(USERINPUT)
Exam Practice

Have a go at this question

AQA-style question
State the most appropriate data type for each of the following variables:
(a) A student's name
(b) Whether a door is open or closed
(c) The average score on a test
(d) The number of pupils in a class
4 marks
(a) String [1]    (b) Boolean [1]    (c) Real [1]    (d) Integer [1]
Key Takeaways

What to Remember

AQA 5 types: Integer, Real, Boolean, Character, String
Integer = whole numbers · Real = decimals
Boolean = True/False only · String = sequence of characters in quotes
Use INT(), REAL(), STR() to cast between types — USERINPUT always returns a String!