In programming, a variable is simply a name or identifier of a location in computer
memory. You may assign the variable a value or it may change over a period of time. When
naming your variables, you may choose a character, a word, or a combination of characters,
numbers, and the underscore (_). Your variable name must, however, begin with a letter or
you may have a variable named 'Amount' and a variable named 'amount' and your browser will not
confuse the two variables. When naming variables, it is a good practice to give them meaningful names,
which reflects the item it holds. So, a variable that holds the unit price of an item bought,
might be called 'unit_price.'
Before you can use any variable in your program, you must first declare it. By declaring it, you are allocating space in the computer's memory so that only this one variable will have access to that space. In declareing variables, use the following format.
Variables may hold numbers or strings. A string is a series of characters, numbers, and spaces. In the following examples we have code for declaring different datatypes.
Arithmetic operators take two numeric values called operands and results in one final number.
Arithmetic operators are:
Comparison operators take two operands and returns a true or false. Comparison operators are:
Boolean operators take two operators and returns a true or false. Boolean operators are:
Strings use the string operator + to concatenate strings together.