Variables
-
A place in the computer's memory to store information.
-
Data can change and be compared.
-
Choosing names:
-
Alphabetic characters, 0-9, underscore
-
Cannot include spaces or punctuation
-
First character must be letter or underscore.
-
Variable names are case sensitive.
-
No official limit, but make them manageable!
-
Correct examples:
cart_total, CartTotal, _cart_total,
cartTotal1, cart2Total, CART_TOTAL
#carttotal, 9cartTotal, cart total, cart.total, cart~total
Global vs. Local Variables
Home
Internet II: Day 2