GCSE

Computer Science

  1. Introduction to GCSE Computer Science
  2. 1. Computer Systems

  3. 1.1 Systems Architecture
  4. 1.2 Memory and Storage
  5. 1.3 Computer Networks, Connections and Protocols
  6. 1.4 Network Security
  7. 1.5 Systems Software
  8. 1.6 Ethical, Legal, Cultural and Environmental Impacts of Digital Technology
  9. 2. Computational Thinking, Algorithms and Programming
  10. 2.1 Algorithms
  11. 2.2 Programming Fundamentals
  12. 2.3 Producing Robust Programs
  13. 2.4 Boolean Logic
  14. 2.5 Programming Languages and Integrated Development Environments
Module Progress
0 / 35 Lessons
0%
Learning
Summary
Revision

In this lesson, we will cover the essential concepts required to build a strong foundation in programming. We will explore the use of variables, constants, operators, inputs, outputs, assignments, and the three basic programming constructs to control the flow of a program: sequence, selection, and iteration (count-controlled and condition-controlled loops). Additionally, we will delve into common arithmetic and boolean operators, as well as the required comparison operators.

Programming Terms

Variables and constants are fundamental building blocks in programming. They allow data to be stored, accessed, and used by a program.

  • Variables: Variables are used to store data in a program. They have a name and a data type (e.g., integer, float, string) and can be updated or modified throughout the program's execution. Data types are covered in Lesson 2.2.2 Data Types.
  • Constants: Constants are fixed values that remain the same throughout the program's execution. They are assigned a value once and cannot be changed during runtime.
Concept OCR Exam-Style Pseudocode Python
Variable x = 3
message = “Hello World!”
Constant const VAT  = 0.2 VAT  = 0.2
Table 36. A comparison of how variables and constants are written in OCR exam-style pseudocode and in Python.

Assignments, operators, inputs, and outputs form the core of how programs process and communicate data.

  • Assignments: Assignments involve storing values in variables. The assignment operator (=) is used to assign values to variables.
  • Operators: Operators are symbols used to perform operations on variables and constants. Arithmetic operators perform mathematical operations (addition, subtraction, multiplication, division, etc.), while Boolean operators perform logical operations (AND, OR, NOT). 
  • Inputs: Inputs are values provided to the program during runtime, allowing users to interact with the program and provide data or information.
  • Outputs: Outputs are the results produced by the program after performing calculations or processing the provided inputs.
Operator OCR Exam-Style Pseudocode Python Explanation
Addition + Adds two values together.
Subtraction - Subtracts the right operand from the left operand.
Multiplication * Multiplies two values.
Division  / Divides the left operand by the right operand.
Modulus (remainder) MOD % Calculates the remainder of the division of the left operand by the right operand.
Quotient (whole number division) DIV // Calculates the integer quotient of the division of the left operand by the right operand.
Exponentiation (e.g. 2³) ^ ** Raises the left operand to the power of the right operand.
Table 37. Arithmetic operators and how they are represented in OCR exam-style pseudocode compared to Python.
Operator OCR Exam-Style Pseudocode Python Explanation
AND && Returns true if both conditions on the left and right sides of the operator are true.
OR || Returns true if at least one of the conditions on the left and right sides of the operator is true.
NOT ! Reverses the logical state of a condition. If the condition is true, NOT makes it false, and if the condition is false, NOT makes it true.
Table 38. Boolean operators and how they are represented in OCR exam-style pseudocode compared to Python.
Operator OCR Exam-Style Pseudocode Python Explanation
Equal to == Checks if two values are equal.
Not equal to != Checks if two values are not equal.
Less than < Checks if the value on the left is less than the value on the right.
Less than or equal to <= Checks if the value on the left is less than or equal to the value on the right.
Greater than > Checks if the value on the left is greater than the value on the right.
Greater than or equal to >= Checks if the value on the left is greater than or equal to the value on the right.
Table 39. Comparison operators and how they are represented in OCR exam-style pseudocode compared to Python.

Note

Only the modulus, quotient, and exponentiation operators differ in the OCR pseudocode.

Continue learning with Knowness

Sign up to access the full lesson, predicted grades, revision tools, progress tracking, and more.

Create a free account