It's dangerous to code alone! Take this.

Knowledge Check - Variables

1. Name the three things all variables have.

All C# variables have a name, a type, and a value. The name is how you refer to it in code, and tell it apart from another variable. The type indicates what type of data can be stored in the variable. The value is the contents of the variable.

2. True/False. All variables must always be declared before being used.

True. You can only use a variable on or after the line it is used.

3. Can you redeclare a variable?

No. You can only declare a variable once. However, you can assign values to variables as many times as you want.

answer, value1, delete_me and PI all follow the rules. A variable cannot begin with a number, so 1stValue is not legal. A variable cannot contain the $ symbol, so $message is not legal. A variable cannot contain a -, so delete-me is not legal.