Subtopic Notes
B - Identifiers and Data Types
Preq. Programming Basics
Variable
- Name given to a distinct memory location and contains a value
- Can be updated throughout the program
Constant
- Name given to a distinct memory location and contains a value
- Cannot be updated once it is created
- It is good practice to use constants if this makes the pseudocode more readable
Data Types
- INTEGER: Represents a whole number
- REAL: Represents a floating point number
- CHAR: Represents a character, surrounded by single quotes (‘A’)
- STRING: Sequence of characters, surrounded by “double quotes”
- BOOLEAN: The logical values True or False
- ARRAY: A list of same data type
- FILE: Resource for recording data in a computer
- NULL: No Value
PYTHON
Python can be executed directly in the browser.
Editor — Python
Output
No output yet.
PSEUDOCODE
Pseudocode uses basic Cambridge-style keyword highlighting. Execution is not supported yet.
Editor — Pseudocode
Identifier
- Name given to an entity distinctly identifying an entity in a program
- Variable names, function names, class names all are identifiers
- It’s a good practice to use PascalCase or camelCase
- Rules
- Must be unique
- Cannot have spaces
- Must begin with a letter
- Can consist of letters, digit or underscore
- Reserved words in the language cannot be used (You’ll notice that in pseudocode, keywords are all written in upper-case)
- Names are case sensitive
