Programming Fundamentals

GCSE Computer Science · Programming

Data types

TypeExampleStores
Integer5whole number
Real / Float5.7decimal
BooleanTrue / Falselogical
Character'A'one symbol
String"hello"text

Variables vs constants

  • Variable – a named store whose value can change while running.
  • Constant – set once, never changes (e.g. VAT = 0.2). Improves readability and safety.

Assignment & casting

age ← 15                 # assignment
price ← float("3.50")    # cast string → real
text  ← str(age)         # cast int → string

Operators

Arithmetic:  +  -  *  /  ^(power)  MOD  DIV
Comparison:  ==  !=  <  >  <=  >=
Boolean:     AND  OR  NOT
  • MOD = remainder: 7 MOD 3 = 1
  • DIV = integer division: 7 DIV 3 = 2

The three constructs

1. Sequence – steps in order

2. Selection – IF decisions

3. Iteration – loops

Exam tip

MOD (remainder) and DIV (whole part) are heavily tested. 15 MOD 2 = 1 is a common way to test if a number is odd/even.

Don't understand a part?

Sign in and ask our AI tutor to explain any passage in plain English.

Try AI explanations →

More on Programming

Selection and Iteration Arrays, Lists and Records Subroutines: Functions and Procedures String Manipulation

← All GCSE Computer Science notes