- 2 points each
- 1 point each
- 2 points each. For the question on polymorphism, 1 point for templates
or generics.
-
- inheritance hierarchy-7 points, 1 point for each class. If the
unary, binary, and nary operators are collapsed into one class by
using a children variable that stores a list then full credit here
but subtract 2 points in variables for using too much storage.
- method placement/declarations-8 points, 3 points for
Evaluate, 2 points for GetValue, SetValue, 1 point for SetValue, markCacheInvalid, and add/removeParameter
- variable placement/declarations-7 points, 2 points for parent (1 for
placement and one for proper type), 1 point for value, 1 point for
upToDate, and 3 points
for children
- constructors--up to 3 extra credit points
- Other things to ensure (3+ points)
- All classes but PlusOperator and Operand should be abstract
- Evaluate should be declared abstract in the top-level class
and defined in Operand and PlusOperator
- GetValue may be declared abstract or defined in the top-level
class. If defined in the top-level class it should be overridden
in the Operator class. if declared abstract in the top-level class
then it should be defined in the Operator and Operand classes.
- Only Operand has a SetValue method so it should not be declared
anywhere else.
- Only an Operator class needs to call markCacheInvalid and
maintain an upToDate flag so they should only be declared in
the Operator class and nowhere else
-
-
- 1 point: uses java, not javac
- 1 point each: classpath flag for /gov/tn and /com/bvz
- 2 points: fully qualified package name--vaccine.Appointment
-
- 1 point: jar command, flags, jar file name
- 2 points: entry point specified as vaccine.Appointment
- 1 point each: vaccine and gui directories included in jar file
- +1 point for using -C flag
-
- 3 points: class declaration with proper template syntax
- 3 points: declaration of instance variables as Lists with proper
template types
- 3 points: appropriate initialization of instance variables on
object creation
- 4 points: add properly declared and values properly added to
instance variables
- 7 points
- 2 points: proper declaration
- 3 points: finds value in bag1 using deep comparison
- 2 points: returns null or appropriate value from bag2 depending
on whether value is found in bag 1
- deductions: if the solution is inefficient or not straightforward,
then use judgement to deduct points.
-
- General guide
- 6 points: Properly uses one Scanner to read lines and a second set of
Scanners to chop lines into names
- 5 points: Prevents a voter from voting twice and prints error message
if voter tries to vote twice
- 7 points: Accurately counts candidate's votes
- 2 points: Prints error message if ballot does not contain voter name and
at least one candidate name
- 3 points: Sorts the candidates in ascending order by vote
- 2 points: Prints the candidates and their votes
- Deductions
- 3 points: Failure to use try/catch to handle exceptions
- 4 points: Using inefficient data structures for storing voters and/or
candidate/vote totals (-2 for using lists/arrays, -1 for using
ordered sets/maps)
- 1 points: Using inefficient or incorrect sorting techniques (should use the Collections
sort methods rather than improvising your own or using a SortedMap)
- 1 point: Failing to close scanners that chop lines into names
- 2 points: Uses an if statement to detect if a ballot has at least one
voter and one candidate name
- Judgement: Unnecessary use of data structures and/or unnecessary code