7.1.1

Variables & Constants

Test yourself on Variables & Constants

Test your knowledge with free interactive questions on Seneca — used by over 10 million students.

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.
Jump to other topics
1

Components of a Computer

2

Software & Software Development

3

Exchanging Data

4

Data Types, Data Structures & Algorithms

5

Legal, Moral, Cultural & Ethical Issues

6

Elements of Computational Thinking

6.1

Thinking Abstractly

6.2

Thinking Ahead

6.3

Thinking Procedurally

6.4

Thinking Logically

6.5

Thinking Concurrently

7

Problem Solving & Programming

8

Algorithms

Practice questions on Variables & Constants

Can you answer these? Test yourself with free interactive practice on Seneca — used by over 10 million students.

  1. 1
  2. 2
    What is an identifier?Multiple choice
Answer all questions on Variables & Constants

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

Get started with Seneca Premium