2.2.1
Programming Fundamentals - Variables & Constants
Variables and Constants
Variables and Constants
We may need to store data in the memory as part of our program.


The memory
The memory
- The memory can be thought of as split up into 'blocks' called words.
- Each word is usually 32 or 64 bits long.
- To access a piece of memory, you have to use its memory address which looks something like 0x9FFF:000F.


Variables
Variables
- To make life easier for programmers, we can give a memory location a symbolic name called an identifier.
- The identifier is a word which describes what we will store in that memory location.
- A variable is any part of the memory that we have named, and that we can change the value of while the program is running.


Constants
Constants
- A constant is a named location in memory that can be used to store a value which does not change while the program is run.


Assignment
Assignment
- The process of setting a value to a variable or a constant is known as assignment.
- Assignment is usually shown using an equals sign, e.g:
- height = 39.
1Computer Systems
1.1Data Representation
1.1.1Binary Numbers
1.1.2Negative Binary Numbers
1.1.3Hexadecimal
1.1.4Using Hexadecimal
1.1.5Converting Binary & Hexadecimal
1.1.6Converting Denary & Hexadecimal
1.1.7Capacity
1.1.8Calculating Capacity Requirements
1.1.9Binary in Computer Systems
1.1.10Data Compression
1.1.11Run Length Encoding
1.1.12File Formats
1.2Data Transmission
1.3Hardware
1.3.1Elements of Computer Systems
1.3.2Types of Computer System
1.3.3Von Neumann Architecture
1.3.4The Fetch, Decode, Execute Cycle
1.3.5Factors Affecting CPU Performance
1.3.6Computational Logic
1.3.7Input Devices
1.3.82D & 3D Scanners
1.3.9Code Readers
1.3.10Solid State Storage
1.3.11Magnetic Storage
1.3.12Examples of Magnetic Storage
1.3.13Optical Storage
1.3.14Examples of Optical Storage
1.3.15Types of Optical disk
1.3.16Storage Requirements
1.3.17Translation - Compilers
1.3.18Translation - Interpreters
1.3.19Translation - Assemblers
1.3.20Acoustic Sensors
1.3.21Flow Sensors
1.3.22Gas Sensors
1.3.23Humidity Sensors
1.3.24Infrared Sensors
1.3.25Level Sensors
1.3.26Light Sensors
1.3.27Magnetic Field Sensors
1.3.28Moisture Sensors
1.3.29pH Sensors
1.3.30Pressure Sensors
1.3.31Proximity Sensors
1.3.32Temperature Sensors
1.3.33Network Hardware
1.5The Internet & its Uses
1.6Cyber Security
1.6.1Forms of Attack
1.6.2Penetration Testing
1.6.3Types of Malware
1.6.4How Malware Spreads
1.6.5Protecting Against Malware
1.6.6Information Security
1.6.7Structured Query Language (SQL) Injection
1.6.8Firewalls
1.6.9Authentication: User Access Levels
1.6.10Authentication: Passwords
1.6.11Social Engineering
1.6.12Phishing
1.6.13Denial of Service Attacks
1.7Automated & Emerging Technologies
2Algorithms, Programming & Logic
2.1Algorithm Design & Problem Solving
2.1.1Computational Thinking - Abstraction
2.1.2Computational Thinking - Decomposition
2.1.3Computational Thinking - Algorithmic Thinking
2.1.4Pseudocode
2.1.5Flow Diagrams
2.1.6Interpreting, Correcting & Completing Algorithm
2.1.7Correcting Algorithms
2.1.8Completing Algorithms
2.1.9Testing
2.1.10Types of Testing
2.1.11Test Plans
2.1.12Validation & Sanitation
2.1.13Authentication & Contingencies
2.2Programming
2.2.1Programming Fundamentals - Variables & Constants
2.2.2Programming Fundamentals - Comments
2.2.3Programming Fundamentals - Input & Output
2.2.4Data Types
2.2.5Casting
2.2.6Controlling Program Flow - Sequence
2.2.7Controlling Program Flow - Selection
2.2.8Controlling Program Flow - Iteration
2.2.9Modularity - Subroutines
2.2.10Modularity - Scope
2.2.11Arrays
Jump to other topics
1Computer Systems
1.1Data Representation
1.1.1Binary Numbers
1.1.2Negative Binary Numbers
1.1.3Hexadecimal
1.1.4Using Hexadecimal
1.1.5Converting Binary & Hexadecimal
1.1.6Converting Denary & Hexadecimal
1.1.7Capacity
1.1.8Calculating Capacity Requirements
1.1.9Binary in Computer Systems
1.1.10Data Compression
1.1.11Run Length Encoding
1.1.12File Formats
1.2Data Transmission
1.3Hardware
1.3.1Elements of Computer Systems
1.3.2Types of Computer System
1.3.3Von Neumann Architecture
1.3.4The Fetch, Decode, Execute Cycle
1.3.5Factors Affecting CPU Performance
1.3.6Computational Logic
1.3.7Input Devices
1.3.82D & 3D Scanners
1.3.9Code Readers
1.3.10Solid State Storage
1.3.11Magnetic Storage
1.3.12Examples of Magnetic Storage
1.3.13Optical Storage
1.3.14Examples of Optical Storage
1.3.15Types of Optical disk
1.3.16Storage Requirements
1.3.17Translation - Compilers
1.3.18Translation - Interpreters
1.3.19Translation - Assemblers
1.3.20Acoustic Sensors
1.3.21Flow Sensors
1.3.22Gas Sensors
1.3.23Humidity Sensors
1.3.24Infrared Sensors
1.3.25Level Sensors
1.3.26Light Sensors
1.3.27Magnetic Field Sensors
1.3.28Moisture Sensors
1.3.29pH Sensors
1.3.30Pressure Sensors
1.3.31Proximity Sensors
1.3.32Temperature Sensors
1.3.33Network Hardware
1.5The Internet & its Uses
1.6Cyber Security
1.6.1Forms of Attack
1.6.2Penetration Testing
1.6.3Types of Malware
1.6.4How Malware Spreads
1.6.5Protecting Against Malware
1.6.6Information Security
1.6.7Structured Query Language (SQL) Injection
1.6.8Firewalls
1.6.9Authentication: User Access Levels
1.6.10Authentication: Passwords
1.6.11Social Engineering
1.6.12Phishing
1.6.13Denial of Service Attacks
1.7Automated & Emerging Technologies
2Algorithms, Programming & Logic
2.1Algorithm Design & Problem Solving
2.1.1Computational Thinking - Abstraction
2.1.2Computational Thinking - Decomposition
2.1.3Computational Thinking - Algorithmic Thinking
2.1.4Pseudocode
2.1.5Flow Diagrams
2.1.6Interpreting, Correcting & Completing Algorithm
2.1.7Correcting Algorithms
2.1.8Completing Algorithms
2.1.9Testing
2.1.10Types of Testing
2.1.11Test Plans
2.1.12Validation & Sanitation
2.1.13Authentication & Contingencies
2.2Programming
2.2.1Programming Fundamentals - Variables & Constants
2.2.2Programming Fundamentals - Comments
2.2.3Programming Fundamentals - Input & Output
2.2.4Data Types
2.2.5Casting
2.2.6Controlling Program Flow - Sequence
2.2.7Controlling Program Flow - Selection
2.2.8Controlling Program Flow - Iteration
2.2.9Modularity - Subroutines
2.2.10Modularity - Scope
2.2.11Arrays
Unlock your full potential with Seneca Premium
Unlimited access to 10,000+ open-ended exam questions
Mini-mock exams based on your study history
Unlock 800+ premium courses & e-books