AQA A-level Computer Science Revision
Data Types: Integer, Real, Boolean, Character, String, Date and Time
Learn what each data type is used for and how to choose the right type in programming questions.
Exam answer
The short version
A data type tells a program what kind of value is being stored and what operations can be performed on it. Common data types include integers for whole numbers, real or float values for decimals, Boolean values for true or false, characters for single symbols, strings for text, and date/time values for temporal data.
Before the list
Data types control what a value can do
When a program stores data, it needs to know whether the value is a number, text, truth value or date/time value. The data type affects memory use, validation and the operations that make sense.
Number types
Integers store whole numbers such as 12 or -5. Real or float types store decimal values such as 3.14. Choose a decimal type when the value can include fractions or measured quantities.
Text and logic types
A character stores a single symbol, while a string stores a sequence of characters. A Boolean stores one of two values, usually true or false, and is useful for conditions and flags.
Date and time values
Date and time data types store values that represent calendar dates, times or both. They are useful when a program needs sorting, comparison or calculation using time-based data.
How to answer it
Choose the type that matches the value
- 1Read the value or field described in the question.
- 2Decide whether it is whole number, decimal, text, one character, true/false or date/time.
- 3Name the most suitable data type.
- 4Explain why that type fits the value and expected operations.
Key terms
Words to use in your answer
integer
real
float
Boolean
character
string
date
time
Exam focus
A-level questions often ask you to choose or justify a data type. The best answers connect the type to the value being stored and the operation being performed.
Quick check
Can you answer these?
- Which data type stores whole numbers?
- When would you use a Boolean?
- What is the difference between a character and a string?
- Why might a date need its own data type?
Practise this topic
Choose the next thing to do
More AQA A-level Computer Science
