Common Reasons for Losing Points on Assignments

Common Reasons for Losing Points on Assignments

Common Reasons for Losing Points on Assignments

  1. Failure 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
  1. Failure to include the proper header at the beginning of the program. Follow the specified model EXACTLY.
  2. Failure 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.
  3. Failure 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
  1. Failure to include blank spaces around operators such as *, -, >, <, etc.
  2. Failure to use int main ( ) at the beginning of the main function rather than main ( ) .
  3. Failure 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;
  1. Failure 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.
  2. Failure to close an external file when you are finished using it.
  3. Failure 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.
  4. Failure to have ALL variable declarations at the top of the main function.
  5. Stapling printouts stapled in the wrong order
  6. Incorrectly naming the source file that was submitted. Do not include blank spaces or the # symbol in the name of a source file.
  7. Mislabeling the floppy disk submitted.
  8. Failure to use constants instead of variables where appropriate. For example, MI sales tax should be a constant rather than a variable.
  9. Failure to provide inline comments to detail the more complicated parts of an algorithm
  10. Failure to include one blank line above and one blank line below each structure including if, switch, do, while, for
  11. Failure 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;

Common reasons for loss of points on pseudocode:

  1. Failure to place the prompt for a user input (usually a cout statement) on a separate line of pseudocode than the actual act of obtaining the input (usually a cin statement)
  2. Misspelling -- you can easily use a spell checker with your pseudocode.
  3. Failure to break down large steps into small ones to show the thought process that you used to help develop an algorithm.
  4. Failure to staple the source file, pseudocode, and test plan in the correct order.

Common reasons for loss of points on a test plan:

  1. Use 0 as a special test value for inputs even if it is not a boundary value
  2. Failure to include a "Reasons" column which explains why each test plan item was included in the test plan (upper boundary, lower boundary, special value, reasonable, etc.)
  3. Failure to number your test case items.
  4. Misspelling. You can easily use a spell checker with Excel spreadsheets.