2.2.4
Arithmetic & Relational Operators
Arithmetic Operators
Arithmetic Operators
Operators are symbols that represent a specific function within a program.
Basic operators
Basic operators
- Addition is done using a + sign.
- Subtraction is done using a - sign.
- Division is done using a / sign.
- Multiplication is done using a * sign.
- Exponentiation is done using a ^ or ** sign.
Modulo operator
Modulo operator
- The modulo operator gives the remainder of the division of two numbers.
- For example:
- 5 MOD (or %) 2 would be equal to 1.
Integer division
Integer division
- The integer division operator returns the quotient (whole part) of a division.
- For example:
- 5 DIV (or //) 2 would give 2.
Relational Operators
Relational Operators
Relational operators compare two values, and produce a True or False value.
Equality
Equality
- We can test if two values are equal using the equality operator. For example:
- 2 = 2 would evaluate to True.
- We can test if two values are not equal using the not-equal-to operator:
- 2 ≠ 2 would evaluate to False.
Comparison
Comparison
- We can compare two numbers using the less than and greater than signs. For example:
- 2 < 3 evaluates to True.
- 2 > 3 evaluates to False.
- We can test for less than or equal, or greater than or equal like this:
- 2 ≤ 3 evaluates to True.
- 3 ≥ 3 evaluates to True.
1Computer Systems
1.1Systems Architecture
1.2Memory & Storage
1.2.1Types of Memory
1.2.2Flash Memory
1.2.3Virtual Memory
1.2.4Exam-Style Questions - Primary Memory
1.2.5Capacity
1.2.6Solid State Storage
1.2.7Magnetic Storage
1.2.8Examples of Magnetic Storage
1.2.9Optical Storage & its Properties
1.2.10Examples of Optical Storage
1.2.11End of Topic Test - Computer Systems
1.2.12Grade 9 - Storage
1.2.13Exam-Style Questions - Storage
1.2.14Units of Information
1.2.15Number Bases
1.2.16Converting Number Bases
1.2.17Hexadecimal
1.2.18Binary Arithmetic
1.2.19Representing Text
1.2.20ASCII & Unicode
1.2.21Representing Images
1.2.22Representing Sound
1.2.23Data Compression
1.2.24End of Topic Test - Representation
1.2.25Exam-Style Questions -Data Conversions
1.3Computer Networks, Connections & Protocols
1.3.1Benefit of Networks
1.3.2Network Performance
1.3.3Networks: How Do Packets Get Routed?
1.3.4Types of Networks
1.3.5Client-Server Model
1.3.6Pros & Cons of Client-Server Model
1.3.7Peer-to-Peer Model
1.3.8Pros & Cons of Peer-to-Peer Model
1.3.9Network Hardware
1.3.10What is the Internet?
1.3.11URLs
1.3.12DNS & Web Hosting
1.3.13The Cloud
1.3.14Pros & Cons of the Cloud
1.3.15Exam-Style Questions - Networking Models
1.3.16Topology
1.3.17WiFi
1.3.18WiFi Encryption
1.3.19IP Addresses
1.3.20MAC Addresses
1.3.21Network Protocols
1.3.22Application Protocols
1.3.23Layers
1.3.24Advantages of Layering
1.3.25Exam-Style Questions - Network Protocols
1.4Network Security
1.5Systems Software
1.6Ethical, Legal, Cultural & Environmental Concern
1.6.1Open Source vs Proprietary Software
1.6.2Licensing Issues
1.6.3Ethical Issues
1.6.4Ethical Issues 2
1.6.5Exam-Style Questions - Ethical Issues
1.6.6Legal Issues
1.6.7Legal Issues 2
1.6.8Freedom of Information Act (2000)
1.6.9Cultural Issues
1.6.10Environmental Issues
1.6.11Positive Environmental Impact
1.6.12Privacy Issues
1.6.13Stakeholders
1.6.14End of Topic Test - Software & Issues
2Computational Thinking, Algorithms and Programming
2.1Algorithms
2.1.1Computational Thinking
2.1.2Algorithmic Thinking
2.1.3Pseudocode & Flow Diagrams
2.1.4Interpreting & Correcting Algorithm
2.1.5Completing Algorithms
2.1.6Search Algorithms
2.1.7Binary Search
2.1.8Overview of Sort Algorithms
2.1.9Bubble Sort & Insertion Sort
2.1.10Merge Sort
2.1.11Exam-Style Questions - Sorting Algorithms
2.2Programming Fundamentals
2.3Producing Robust Programs
2.4Boolean Logic
Jump to other topics
1Computer Systems
1.1Systems Architecture
1.2Memory & Storage
1.2.1Types of Memory
1.2.2Flash Memory
1.2.3Virtual Memory
1.2.4Exam-Style Questions - Primary Memory
1.2.5Capacity
1.2.6Solid State Storage
1.2.7Magnetic Storage
1.2.8Examples of Magnetic Storage
1.2.9Optical Storage & its Properties
1.2.10Examples of Optical Storage
1.2.11End of Topic Test - Computer Systems
1.2.12Grade 9 - Storage
1.2.13Exam-Style Questions - Storage
1.2.14Units of Information
1.2.15Number Bases
1.2.16Converting Number Bases
1.2.17Hexadecimal
1.2.18Binary Arithmetic
1.2.19Representing Text
1.2.20ASCII & Unicode
1.2.21Representing Images
1.2.22Representing Sound
1.2.23Data Compression
1.2.24End of Topic Test - Representation
1.2.25Exam-Style Questions -Data Conversions
1.3Computer Networks, Connections & Protocols
1.3.1Benefit of Networks
1.3.2Network Performance
1.3.3Networks: How Do Packets Get Routed?
1.3.4Types of Networks
1.3.5Client-Server Model
1.3.6Pros & Cons of Client-Server Model
1.3.7Peer-to-Peer Model
1.3.8Pros & Cons of Peer-to-Peer Model
1.3.9Network Hardware
1.3.10What is the Internet?
1.3.11URLs
1.3.12DNS & Web Hosting
1.3.13The Cloud
1.3.14Pros & Cons of the Cloud
1.3.15Exam-Style Questions - Networking Models
1.3.16Topology
1.3.17WiFi
1.3.18WiFi Encryption
1.3.19IP Addresses
1.3.20MAC Addresses
1.3.21Network Protocols
1.3.22Application Protocols
1.3.23Layers
1.3.24Advantages of Layering
1.3.25Exam-Style Questions - Network Protocols
1.4Network Security
1.5Systems Software
1.6Ethical, Legal, Cultural & Environmental Concern
1.6.1Open Source vs Proprietary Software
1.6.2Licensing Issues
1.6.3Ethical Issues
1.6.4Ethical Issues 2
1.6.5Exam-Style Questions - Ethical Issues
1.6.6Legal Issues
1.6.7Legal Issues 2
1.6.8Freedom of Information Act (2000)
1.6.9Cultural Issues
1.6.10Environmental Issues
1.6.11Positive Environmental Impact
1.6.12Privacy Issues
1.6.13Stakeholders
1.6.14End of Topic Test - Software & Issues
2Computational Thinking, Algorithms and Programming
2.1Algorithms
2.1.1Computational Thinking
2.1.2Algorithmic Thinking
2.1.3Pseudocode & Flow Diagrams
2.1.4Interpreting & Correcting Algorithm
2.1.5Completing Algorithms
2.1.6Search Algorithms
2.1.7Binary Search
2.1.8Overview of Sort Algorithms
2.1.9Bubble Sort & Insertion Sort
2.1.10Merge Sort
2.1.11Exam-Style Questions - Sorting Algorithms
2.2Programming Fundamentals
2.3Producing Robust Programs
2.4Boolean Logic
Unlock your full potential with GoStudent tutoring
Affordable 1:1 tutoring from the comfort of your home
Tutors are matched to your specific learning needs
30+ school subjects covered