2.2.1

Programming Fundamentals - Variables & Constants

Test yourself on Programming Fundamentals - 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

Computer Systems

1.1

Data Representation

1.2

Data Transmission

1.3

Hardware

1.4

Software

1.5

The Internet & its Uses

1.6

Cyber Security

1.7

Automated & Emerging Technologies

2

Algorithms, Programming & Logic

Practice questions on Programming Fundamentals - 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 Programming Fundamentals - 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