Assignment Grading
Assignments will be graded according to the following rules,
adapted as necessary to the particulars of the assignment.
The numbers below assume that the grade is out of 100. If the assignment is graded out of some other number (such as 20) the actual penaltiy amounts will be suitably revised (e.g. 10 points out of 100 becomes 2 points out of 20).
-
Execution: 40-60 points
Forty to sixty percent of the grade for an assignment is based on
whether the submitted code does what it's supposed to.
-
Design: 20-40 points
Twenty to forty percent of the grade for an assignment
is based on whether the design you use
is what the assignment required
and appropriate for the task you are carrying out.
This includes (but is not limited to)
- using proper loop control,
- giving methods a clear single purpose,
- keeping methods relatively short
(under 20 lines if possible) by abstracting major operations,
- making appropriate use of library methods, and
- including appropriate parts for data structures.
-
Style: 10-20 points
Ten to twenty percent of the grade of each assignment
will be based on the style of the code files submitted.
This includes (but is not limited to):
-
Line Length:
All lines must be less than 80 characters long.
-
Blank Lines:
There must be one blank line between each logical section of code.
There should not be more than one line between those sections.
There should not be blank lines at the beginnings of blocks
(unless they are separating code from comment lines).
Your code should not have every other line blank.
-
Operator Spacing:
There should be one space on either side of each binary operator.
There should be no spaces before postfix unary operators
nor after prefix unary operators.
Spaces may be omitted in very long lines,
but must be omitted in a pleasing and logical pattern --
either both spaces or neither (for binary operators),
and spaces are removed in a way that keeps sub-expressions together.
(For example, a+b * c is wrong because b*c is done before a+b.
If it is necessary to remove some spaces from a + b * c,
then remove the ones around the * first: a + b*c.)
-
Name Style:
Names must follow the style guidelines for what it is that's being named.
For example:
- variableName
- parameterName
- CONSTANT_NAME
- methodName
- UserDefinedClassName
-
Name Content:
Objects names must indicate what they are.
For example:
- Variable names typically state what is in them --
studentName, characterCount, ....
Boolean variable names suggest what (yes/no) question they answer --
eligible (or isEligible), failed (or didFail), ....
- Methods that return values are usually named after what they return --
squareRoot, area, ....
Methods that return boolean values
are named after the (yes/no) question they answer --
userSaysYes, isOpen, ....
Methods that return an instance value for an object
are generally named using the verb get
and the name of the value they are returning --
getWidth, getHeight, getArea, ....
- Methods that do not return values
are named for what they do ---
liftBarge, toteBale, drawBox, ....
- Classes are named for the kind of object they represent ---
Sound, Pixel, Car, ... ---
or for the kinds of methods they collect ---
PrintHelper, Conversion, ....
-
Comments:
-
There should be a comment on pretty much every logical section of code
stating what it is the program is doing in that section.
There should be comments on any bit of code
that is dealing with a potential problem
that might not be obvious
(or the solution to which might not be obvious)
saying what the problem is
(or how the solution works).
-
Identifying comments are required for every code file submitted.
This comment must include your name and student number,
and a brief description of the purpose of the file.
The usual form is as follows
(you may copy this and make the appropriate changes in your file):
/**
* This program demonstrates adding up the digits of a number.
*
* @author Mark Young (A00000000)
*/
-
Wrong Name
Files passed in with the wrong name will be penalized
10 points for the first file,
and 5 points for the second and further files,
to a maximum of 25 points in penalties.
These points will be deducted
even if the file name is "only a little bit wrong".
The computer does not deal well with even "little" errors.
The grading will often require that I link the file(s) you provide
with code of my own.
If your files have the wrong name,
I have to make changes to get them to work together.
In a job situation
that would be your manager having to fix mistakes in work you provided ---
so not the way to get that big raise you want.
-
Does Not Compile
Java code files that generate an error message
when they are compiled
will be penalized 20 points for the first file,
and 10 points for the second and further files,
to a maximum of 100 points.
That is on top of any penalties for parts of it that don't work.
When you pass in a file that doesn't compile,
I will try to salvage as much of your program as I can
in my attempts to get it to compile,
but I will add the least I can get away with to make it compile.
I will base your (remaining) grade on the resulting code.
If in my judgement it would take too much work to get it to compile,
I will assign a grade of 0 to the assignment.
-
Does Not Link
Java programs that fail to access files that they need
(whether data files or code files)
when run on the grader's computer
will be penalized 10 points for each failed link
(i.e., each "unresolved external" or like),
to a maximum of 100 points.
This penalty will not be charged to files that fail to compile
unless it is clear that the changes needed to get it to compile
would leave it not linking.
I will attempt to solve linkage problems
by making minor changes to the Java code.
Your assignment will be graded based on its performance as modified.
-
Not Passed In
Assignments not passed in by the due date will be assigned a grade of 0.
No late assignments will be accepted.
Note that it is possible
to suffer more than 100 points of penalties under the scheme described above.
Your grade, however,
will not go below zero,
so you may submit programs that don't work
in hope of partial credit.