Data types, variables and constants (Edexcel GCSE Computer Science): Flashcards
📚Flashcards
Practise the cards
13 cards from this deck
ShowHide
Practise the cards
13 cards from this deck
What are variables?
What are variables?
Named storage areas in memory with specific data type
Constants
Constants
Named storage areas whose values never change during program execution
Key characteristic of variables
Key characteristic of variables
Contents can change but data type stays the same
Integer data type
Integer data type
Stores whole numbers
Real or Float data type
Real or Float data type
Stores numbers with decimal points/fractional parts
Boolean data type
Boolean data type
Stores only True or False values
String data type
String data type
Stores text values between single or double quotes
Declaration
Declaration
Allocates memory space for a variable
Initialization
Initialization
Sets the first value in memory space
Implicit data typing
Implicit data typing
Data type determined from first assignment
Constants naming convention
Constants naming convention
Written in UPPER CASE letters
Why use constants
Why use constants
Reduces errors; only define value once
Why data types matter
Why data types matter
Computer knows memory to allocate & operations allowed
