GCSE · Computer Science · AQA · Spec 8525
Integer data type
Your phone number is nothing but digits. So why would a good programmer never store it as a number?
Computer Science · Data types
Integer or not? You decide
Would you store this value as an integer? Pick a value, then pick where it belongs.
Still to sort
Store as an integer (0)
Whole numbers — positive, negative or zero — that you count or calculate with.
Where the line is: Being made of digits isn't enough. The value must be a whole number that behaves like an amount.
Needs a different data type (0)
Values with a fractional part, or digits that are really a label.
Where the line is: A fractional part rules integer out. So does a value you'd never do sums with.
Six values a program might need to store. Sort each one, then read why.
AQA exam questions use the general names integer, real, Boolean, character and string. Write integer, even if the language you use calls it int.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
Not every value made of digits is one — and choosing wrong can break a program.
What you need to know
- A data type decides what kind of value can be stored and what the program can do with it.
- An integer is a whole number: positive, negative or zero, with no fractional part.
- Choose integer for whole-number values you count or calculate with, such as scores, quantities and floor numbers.
- Common data types include integer, real (float), string and Boolean.
- Languages have their own names for types — Python calls the integer type int — but the general name is integer.
- Using an incorrect data type can cause errors: the program may stop, or it may run and give a wrong answer.
The big picture
A data type tells a program what kind of value it is holding and what it can do with it. The integer type holds whole numbers — positive, negative or zero — and it is the right choice for values you count or calculate with. Digits that are really a label, like a phone number, belong in a string, and values with a fractional part need a real. Choose the wrong type and a program can stop with an error or, worse, quietly give the wrong answer.
Key points
Worked example
Problem
A cinema records how many people watched a film on each of 5 nights: 120, 135, 128, 141 and 130. The program stores each night's attendance and also the mean attendance. Choose a data type for each night's attendance and for the mean.
⚠ Watch out
Choosing integer just because a value is made of digits. A phone number or a PIN like 0042 is all digits, but you never calculate with it, and storing it as an integer loses the leading zeros. Store it as a string.
Memory hook
Whole, and worth doing sums with? Integer. Got a point in it, or just digits used as a label? Not an integer.
Check yourself
Which of these values could be stored as an integer: 17, -40, 0, 2.5 and a door code written as 0199? For each one you rule out, say which property rules it out.
Flashcards
(10)What does a data type decide?
What is an integer?
Are -5 and 0 integers?
When should you choose the integer type?
Why isn't a phone number stored as an integer?
Which type holds a value like 2.75?
Name four common data types.
Python calls it int. What is the general name?
In Python, what type does input() give back?
What can go wrong if a value has the wrong data type?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore AQA GCSE Computer Science topics
How this lesson was checked. This AQA GCSE Computer Science (specification 8525)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 29 September 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.