Instructions for signature: All of your programs must contain the following format of the program signature in the beginning of the program. 

 

/* Author Name:                                       */ (Write your name)

/* Student ID:                                           */ (Write your student ID)

/* Program Name:                                    */ (Give an appropriate name to the program)

/* Program Description:                            */ (Write little description about what your program does)

/* Date of creation                                    */ (Write date of creation of the program)

/* Lab section:                                          */ (Write your lab section)

 

This signature will help the markers to identify your assignments. Do proper indentation of your programs. That means your program should be aligned properly. Also one more important thing. Do a reasonable commenting of your program. What do I mean is through out your program please write little description about the program flow.

 

E.g. In the beginning of the program write little description about the variables you have declared. Here’s a sample of what I’m discussing above.

 

 

/*Author name: Toby McGuire */

/*Student ID: 230051XXXX */

/*Program name: multiply.cpp */

/*Description: This program takes two integer values from the user, multiply them and

print the result on the screen */

/*Date of creation: 10th March 2004 */

/*Lab Section: C3*/

 

#include <iostream>

using namespace std;

 

int main ()

{

int FirstInteger, SecondInteger; /*Two variable of integer type to be used for user input */

int Result; /*Variable to store the result of two integers */

FirstInteger = 0;                       //Initializing the values to 0.

SecondInteger = 0;                      // Note: you can do declaration and initialization in one step as well.

Result = 0;

cout << "Please enter the first integer : "; /*Asking user to input first integer */

cin >> FirstInteger; /*User input of first integer*/

cout << "Please enter the second integer : "; /*Asking user to input second integer */

cin >> SecondInteger; /*User input for second integer*/

Result = FirstInteger * SecondInteger;

cout << "Multiplication of " << FirstInteger << " and " <<  SecondInteger

       << " is equal to " << Result <<endl;  //Printing result

return 0;

}

 

A word of caution: There is no standard for indentation. But be consistent what ever format you adopt.

 

Back to general instructions page