Questions: Memory, Data Storage, and Variables

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

After the following three lines execute, what is the value of x? x = 5 x = x + 3 x = x * 2

A16
B5
C26
D10
Question 2 Multiple Choice

Which statement best describes what a variable is in a computer program?

AA named location in memory where a value can be stored and changed
BA permanent label attached to a specific value that travels with it
CA mathematical symbol representing an unknown, like in an algebra equation
DA formula that computes a result each time it is evaluated
Question 3 True / False

When you write `name = 'Alice'` and then `name = 'Bob'`, the program stores both values and you can access either one later.

TTrue
FFalse
Question 4 True / False

The order in which assignment statements appear in a program can change the final value of a variable.

TTrue
FFalse
Question 5 Short Answer

A student writes `score = 0` at the start of a program, then later writes `score = 100`. They expect the program to remember that the score was once 0. What actually happens, and why does this matter?

Think about your answer, then reveal below.