C/C++ Comment Standards
I. File Header
Each file in the solution shall have a comment block which identifies:
The file name,
The author of the file,
Modification History
a Who modified the file b When
The classes/procedures in the file with a one line description
/***************************************************************************
File: c
Author: Richard Goodrum
Procedures:
main - test program which initializes the data elements, time matmul, and prints results
matmul - brute force matrix multiplication
***************************************************************************/
II. Class/Procedure Header
Each class/procedure shall have a comment block preceding it which contains:
The class/procedure name,
The author of the class/procedure,
Modification History
Who modified the class/procedure
When
A summary description of the class/procedure, 4. A list of all arguments with:
Argument name,
Direction: Input (I/P), Output (O/P), Input/Output (I/.O),
Type (I.e., char, double, float, int, long, ),
One line description of the
/***************************************************************************
int main( int argc, char *argv[] )
Author: Dr. Richard A. Goodrum, D.
Date: 16 September 2017
Description: Generates two matrices and then calls matmul to multiply
Finally, it verifies that the results are
*
Parameters:
* argc |
I/P |
int |
The number of arguments on the command line |
* argv |
I/P |
char *[] |
The arguments on the command line |
* main |
O/P |
int |
Status code (not currently used) |
**************************************************************************/
/***************************************************************************
int matmul( int l, int m, int n, float *A, float *B, float *C )
Author: Dr. Richard A. Goodrum, D.
Date: 16 September 2017
Description: brute force matrix multiplication function.
*
Parameters:
* l |
I/P |
int |
The first dimension of A and C |
* m |
I/P |
int |
The second dimension of A and first of B |
* n |
I/P |
int |
The second dimension of B and C |
* A |
I/P |
float * |
The first input matrix |
* B |
I/P |
float * |
The second input matrix |
* C |
O/P |
float * |
The output matrix |
* matmul |
O/P |
int |
Status code (not currently used) |
***************************************************************************/
III. Inline Comments
Many lines of the file should include comments to describe the concept represented by the line. For example:
y = m * x + b; // Calculate the value of y based on a linear equation and
// the value of x
IV. Other Comments
Occasionally, a block of code needs a preamble to explain its nature. Hence, a block comment should precede it.
int matmul( int l, int m, int n, float *A, float *B, float *C )
{
int i, j, k;
for( i=0; i<l; i++ ) // Loop over the rows of A and C.
for( k=0; k<n; k++ ) // Loop over the columns of B and C
{
// Initialize the output element for the inner
// product of row i of A with column j of B C[i*n+k] = 0;
for( j=0; j<m; j++ ) // Loop over the columns of A and C
{
C[i*n+k] += A[i*m+j] * B[j*n+k]; // Compute the inner product
}
}
}
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme