Common Reasons for Losing Points on Assignments

1/...failing to include a variable dictionary, which consists of inline comments to the right of the variable declarations. The comments should explain the purpose of each variable even if the name of the variable is self-documenting. Do not use an inline comment such as "// declaring lengthOfFrame as an integer variable" but rather something like "// total vertical length of frame". Do not declare multiple variables on one line of code even though this is possible in C++. That is,

Declare variables like this....

Not like this....
int lengthFrame = 0; 
area = 0.0;
// total vertical length of frame
// total area of frame
int lengthOfFrame, widthOfFrame; // user inputs

2/ ...failing to include the proper header at the beginning of the program. Follow the specified model EXACTLY.

3/ ...failing to use the correct method for naming variables.  Variables should be whole words or concatenated phrases that describe the values they represent. I specify that identifiers begin with a lowercase letter but have consecutive words that begin with capital letters without using underscores (eg. numStudents, homePhoneNumber). However, constants must be named with uppercase letters and underscores.

4/ ...failing to document the end of the main function or any other user-defined function by providing an inline comment after its closing brace. 

Document the end of your main function like this...
     ....
     return 0;
}   // end of main

5/ ...failing to include blank spaces around operators such as *, -, >>, <<, etc.

6/ ...failing to use     int main ( )     at the beginning of the main function rather than     main ( )    .

7/ ...failing to keep the user's input on the same console line as the corresponding input prompt. Also, I prefer that you use colons to between the prompt and the user's inputted value. 

Obtain input like this....

Not like this....
cout << "Please type the width in whole inches: ";
cin >> widthOfFrame;
cout << "Please type the width in whole inches." << endl;
cin >> widthOfFrame;

8/ ...failing to use suitable input prompts so that the user knows what data to enter and how to format the data. If the user is expected to type whole numbers, for example, you should prompt him or her to do exactly that.

9/ ...if an external file is used, you should close the file when you are finished using it.

10/ ...failing to indent statements that wrap around to a second line of code. You should take the time to make sure that your code is neat, presentable, and easy to read before you submit an assignment. See the instructor if you have difficulty printing programs with the Visual C++ compiler.

11/ ...failing to have ALL variable declarations at the top of the main function.

12/ ...printouts stapled in the wrong order

13/ ...source file named incorrectly in Angel. Do not include blank spaces or the # symbol in the name of a source file.

14/ ...failing to use constants instead of variables where appropriate. For example, PA sales tax should be a constant rather than a variable.

15/ ...failing to provide inline comments to detail the more complicated parts of an algorithm

16/ ...failing to include one blank line above and one blank line below each structure including if statements, while & for loops & functions

17/ ...failing to initialize variables that need to be initialized within their declaration statements. Usually int variables should be initialized to 0 and double variables should be initialized to 0.0. Do not declare a variable and then use an assignment statement to set it to a certain value if you can initialize it in an initialization statement.

do initialize variables in their declaration statements like this....   do not do this....
int lengthOfFrame = 0;   int lengthOfFrame;
lengthOfFrame = 0;