Comments in Assignments

Here is an example of the comments required for every assignment. You will always need an opening comment that will have all the information that is shown in the example. You will always need a variable dictionary explaining what all your variables are used for. You need to explain what various parts of your program are doing. Be sure to use proper indentation (use a tab for each indentation). Do put a box around the opening comment and variable dictionary so they stand out from the rest of your program.

/*********************************************************
*  Name: Your Name                                       *
*  Course: ICS 3U 02  Pd. 8                              *
*  Assignment #2                                         *
*  Purpose: One or two sentence purpose of the program.  *
*  Due Date: October 9, 2012                             *
*********************************************************/

void setup()
{
   /*** Variable Dictionary ***************************
   * number - number that user enters                 *
   * root - the square root of the number entered     *
   ***************************************************/
   int number;
   float root;
      
   // Read input & calculate results
   number = getInt("Enter a number");
   root = sqrt(number);
      
   // Print results
   print("The square root of " + number + " is ");
   print(root);
   println(".");
}