|
|
|
|
|
|
|
Hour 3
Variables and Constants |
|
|
|
|
|
|
|
|
Programs need a way to store the data they use. Variables and constants offer various ways to work with numbers and other values. |
|
|
|
|
|
|
|
|
How to declare and define variables and constants |
|
|
|
|
|
|
|
|
How to assign values to variables and manipulate those values |
|
|
|
|
|
|
|
|
How to write the value of a variable to the screen |
|
|
|
|
|
|
|
|
New Term: You might remember variables from high school (let InterestRate = .75). |
|
|
|
|
|
|
|
|
From a programmer's point of view, a variable is a location in your computer's memory in which you can store a value and from which you can later retrieve that value. |
|
|
|
|
|
|
|
|
To understand this, you must first understand a bit about how computer memory works. Your computer's memory can be thought of as a series of |
|
|
|
|
|