Section 4.4 Modifying Variables
After declaring and initializing a variable, the stored value is not set in stone. It can be updated!
Next, we’ll learn how to modify the value of a variable in a program.
If you cannot see this codecast, please click here.
Check Your Understanding Check Your Understanding
1.
Suppose you declare and initialize a variable at the beginning of your program as follows:
What is the value of the variable
var
after the line
2.
Continuing from the question above, your program now contains the next line:
3.
Finally, your program contains the two lines: