Constant+and+Variable+Declaration+(Trevor+Jewkes)

This ILM would be used to explain when it would be necessary to declare a variable as a constant. For example, if it needs to remain the same and not undergo a change that could accidentally happen. Another aspect of variables that could be included is the difference between when to use an integer variable and when a floating point variable would be better.

Another main topic that could be included here would be how to name variables appropriately. It would include avoiding keywords, naming that gives reference to what it is used for (ie not using variable name "dog" to describe the number of cats) and appropriate format for naming the variables. It also should tell the user to put in a comment on what the variable is and what it is going to be used for to simplify the programming process.

Vicki: In naming variables (or methods), people always think their names are great. What if we had a game where students tried to guess the meaning behind a variable name? Then students would see the difficulty someone else has in reading a variable name.

Here are some examples which could be misunderstood: 1. phoneNo( a. phone number b. whether texting is okay) 2. sum (a. sum of values b. total so far or grand total) 3. xInt (a. integer value of x b. value of x intercept) 4. flag (a. what are we flagging? b. what does true mean?) 5. college (how is it coded? current college?)

Methods would be even more interesting as reader would need to guess what inputs and outputs are. What if we gave them a method and had them supply the comments? The only feedback would be what the writer thought the comments should have been, unless we could have students vote on the right answer and show tallies. Maybe it would be self graded? Not a great ILM because of the lack of interactivity.