Data Types (OCR A-Level Computer Science): Flashcards
📚Flashcards
Practise the cards
12 cards from this deck
ShowHide
Practise the cards
12 cards from this deck
What are primitive data types?
What are primitive data types?
Most basic data types provided by a programming language
What is an integer data type?
What is an integer data type?
Whole numbers (positive, negative, or zero) with no decimal points
What is a real/floating-point data type?
What is a real/floating-point data type?
Numbers with fractional parts (decimals)
What are the Boolean data type values?
What are the Boolean data type values?
Two possible values: true or false
What is a character data type?
What is a character data type?
Stores a single character (letter, digit, or symbol)
What is a string data type?
What is a string data type?
A sequence of characters used to store text
How much memory does Boolean use?
How much memory does Boolean use?
Uses a single bit of memory
Real/float memory vs integer
Real/float memory vs integer
Uses more memory than integers
Boolean True to integer conversion
Boolean True to integer conversion
True becomes 1
Boolean False to integer conversion
Boolean False to integer conversion
False becomes 0
Float to integer conversion effect
Float to integer conversion effect
Truncates decimals (e.g., 4.5 becomes 4)
When do precision errors occur?
When do precision errors occur?
Using floats where exact values needed (e.g., finance)
