Variables and constants (Edexcel GCSE Computer Science): Flashcards
📚Flashcards
Practise the cards
12 cards from this deck
ShowHide
Practise the cards
12 cards from this deck
What is a variable?
What is a variable?
A container that holds values that can change during a program
What is a constant?
What is a constant?
A container with a value that cannot change once set
What are identifiers?
What are identifiers?
Names given to variables and constants
What is best practice for naming identifiers?
What is best practice for naming identifiers?
Use meaningful, descriptive names; avoid short unclear names
Can identifiers be reserved words?
Can identifiers be reserved words?
No, identifiers cannot be the same as reserved words
Variable naming convention
Variable naming convention
camelCase (lowercase start, capitalise new words)
Constant naming convention
Constant naming convention
ALL UPPER CASE letters
What is assignment?
What is assignment?
Process of storing a value in a variable or constant
Assignment symbol in program code
Assignment symbol in program code
Equals symbol (=)
Assignment notation in flowcharts
Assignment notation in flowcharts
SET...TO (e.g., SET score TO 85)
Command to get user input
Command to get user input
GET or input()
Command to display variable values
Command to display variable values
OUTPUT or print()
