Data Types (CIE IGCSE Computer Science)

Revision Note

Test Yourself
Becci Peters

Expertise

Computer Science

Data Types

  • 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:

    • Integer: used to represent whole numbers, either positive or negative

      • Examples: 10, -5, 0

    • Real: used to represent numbers with a fractional part, either positive or negative

      • Examples: 3.14, -2.5, 0.0

    • Char: used to represent a single character such as a letter, digit or symbol

      • Examples: 'a', 'B', '5', '$'

    • String: used to represent a sequence of characters

      • Examples: "Hello World", "1234", "@#$%

    • Boolean: used to represent true or false values

      • Examples: True, False

We can declare variables as follows:

 


Python


Java


Visual Basic

Syntax

variable_name = value

data_type variable_name;

Dim variable_name As data_type

Example

x = 5

int x

Dim x As Integer

It is important to choose the correct data type for a given situation to ensure accuracy and efficiency in the program.

Worked example

Name and describe the most appropriate programming data type for each of the examples of data given. Each data type must be different

[6]

Data: 83

Data type name: Integer [1]
Data type description: The number is a whole number [1]

 

Data: [email protected] 

Data type name: String [1]
Data type description: It is a group of characters [1]

 

Data: True

Data type name: Boolean [1]
Data type description: The value is True (or could be False) [1]

You've read 0 of your 0 free revision notes

Get unlimited access

to absolutely everything:

  • Downloadable PDFs
  • Unlimited Revision Notes
  • Topic Questions
  • Past Papers
  • Model Answers
  • Videos (Maths and Science)

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

Becci Peters

Author: Becci Peters

Becci has been a passionate Computing teacher for over 9 years, teaching Computing across the UK helping to engage, interest and develop confidence in the subject at all levels. Working as a Head of Department and then as an educational consultant, Becci has advised schools in England, where her role was to support and coach teachers to improve Computing teaching for all. Becci is also a senior examiner for multiple exam boards covering GCSE & A-level. She has worked as a lecturer at a university, lecturing trainee teachers for Computing.