Computer Science GCES AQA
-
Representing Algorithms Aqa4 主题
-
Efficiency Of Algorithms Aqa1 主题
-
Searching Algorithms Aqa3 主题
-
Sorting Algorithms Aqa3 主题
-
Data Types Aqa1 主题
-
Programming Concepts Aqa5 主题
-
Arithmetic Relational And Boolean Operations Aqa1 主题
-
Data Structures Aqa3 主题
-
String Manipulation Aqa1 主题
-
Random Number Generation Aqa1 主题
-
Structured Programming Aqa2 主题
-
Robust And Secure Programming Aqa4 主题
-
Number Bases Aqa2 主题
-
Converting Between Number Bases Aqa3 主题
-
Units Of Information Aqa9 主题
-
Hardware And Software Aqa4 主题
-
Boolean Logic Aqa3 主题
-
Programming Languages And Translators Aqa2 主题
-
Cpu Architecture Performance And Embedded Systems Aqa4 主题
-
Memory Aqa2 主题
-
Secondary Storage Aqa3 主题
-
Fundamentals Of Computer Networks Aqa8 主题
-
Fundamentals Of Cyber Security Aqa1 主题
-
Methods Of Preventing Cyber Security Threats Aqa1 主题
-
Relational Databases Aqa2 主题
-
Ethical Legal And Environmental Impacts Aqa2 主题
Data Types And Casting Aqa
Exam code:8525
Data Types & Casting
What is a data type?
-
A data type is a classification of data into groups according to the kind of data they represent
-
Computers use different data types to represent different types of data in a program
-
The basic data types include:
|
Data type |
Used for |
Example |
|---|---|---|
|
Integer |
Whole numbers |
10, -5, 0 |
|
Real |
Numbers with a fractional part |
3.14, -2.5, 0.0 |
|
Character |
Single character |
‘a’, ‘B’, ‘6’, ‘£’ |
|
String |
Sequence of characters |
“Hello world”, “ABC”, “@#!%” |
|
Boolean |
True or false values |
True, False |
-
It is important to choose the correct data type for a given situation to ensure accuracy and efficiency in the program
-
Data types can be changed within a program, this is called casting or String handling operations
-
You can read more about string handling operations and converting data types here
Worked Example
Customers booking a holiday can choose between half board or all inclusive and a hotel star rating between 1 and 5
A typical booking record is shown in the table:
|
firstName |
Jacob |
|
lastName |
Franks |
|
boardType |
All inclusive |
|
starRating |
5 |
|
bookingComplete |
True |
State the most appropriate data type for the following fields [2]:

Give the name of one field that could be stored as a Boolean data type [1]
Answer

-
bookingComplete
Responses