Adventures in Programming

Site Stats
APCS schedule | APCS Login | APCS Forms | APCS Resources | APCS Archive | APCS Stuff
C++ schedule | C++ Login | C++ Forms | C++ Resources | C++ Archive | C++ Stuff
Adven schedule | Adven Login | Adven Forms | Adven Resources | Adven Archive | Adven Stuff
Stats schedule | Stats Login | Stats Forms | Stats Resources | Stats Archive | Stats Stuff

Comments

Comments are parts of the source code that the compiler ignores. There are two types of comments in C++. One type of comment is the line comment and the other is the block comment.

Line Comments

A line comment starts with // . Anything to the right of the // will be ignored by the compiler. We use this in IDOC

Block Comments

Block comments start with the symbols /* and the end of the comment is symbolized as */ . Block comments can extend over as many lines as needed. We use this when pasting sample output.

What is the purpose of comments in a program?

1. Explain the components of the code to someone else who may read or need to modify it.
2. A way the programmer can insert notes inside the program. A way for the programmer to remember.
3. Identifies the author of the program.

Adventures in Programming Required Commenting

1. The beginning of every program will start with three lines of line comments referred to a IDOC.
2. Source Code documentation requirements will be covered in class.
3. The very end of every program will contain a copy of the sample output. The sample output will use block comments.

First line : first and last name
Second line : date started
Third line : computer station

 

 

 

 

 

Updated: Wednesday, January 13, 2010 11:22 AM

About Us | Site Map | Contact Us | Search | ©2005 brentwoodhigh.com