Introduction to Computer Science I by James Tam

Return to the course web page

CPSC 231: Assignment 5 (Marking Key)

    Your score Max score

Coding style (marks independent of program functionality)

   
 
  • Appropriate use of white space (source code)
  2
 
  • Self-documenting variable and constant names.
  3
 
  • Use of named constants as appropriate
  1
 
  • Boolean and mathematical expressions are simple and easy to read
  3
 
  • Each function/method implements one well defined task
  4
 
  • Functions/methods don't exceed one screen size in length ~20 - 30 lines
  2
 
  • Class Attacker consists of at least 2 methods (__init__  and something to generate an attack)
  2
 
  • Class Defender consists of at least 2 methods (__init__ and something to generate a defense)
  2
 
  • Class attributes are logical to the definition (e.g., not variables that are just local to a function or method but belong to each instance)
  2
 
  • The Manager module contains at least two methods
  2
 
  • Global variables employed (unless otherwise allowed in the specifications or starting example program)
  -4
 
  • The code for the 2 classes and the manager functionality is not included in its own module (and in the correct module)
  -9 (3 each)
 

Sub total

 

23

Documentation (marks independent of program functionality)

   
 
  • Header documentation includes name and tutorial section
  1
 
  • Header documentation contains description of program.
  1
 
  • Some form of versioning system is demonstrated in the header documentation
  1
 
  • Each function/method is documented (similar to documentation for the entire program but applies only to that function/method)
  6
 

Sub total

 

9

Functionality (only qualify for these marks if the program runs: note some features obviously requires other features to be implemented before credit will be granted)

   
 
  • Program prompts user for the number of rounds
  1
 
  • Program runs for the specified number of rounds
  1
 
  • Program error checks number of rounds and can set default
  2
 
  • Program prompts user for the probabilities of the three attack types
  3
 
  • Program error checks probabilities can set default probabilities
  2
 
  • Program generates attacks with equal probability of each
  6
 
  • Program generates defenses with equal probability of each
  6
 
  • Program can correctly determine the effect of attack/defense
  2
 
  • Program displays appropriate statistics for each round (if insufficient statistic are displayed you may not only lose marks for this feature but you may also lose marks for the other features if it is not clear if/how features are working)
  6
 
  • Program displays appropriate statistics at the end of the simulation (f insufficient statistic are displayed you may not only lose marks for this feature but you may also lose marks for the other features if it is not clear if/how features are working)
  2
 
  • Probability of each attack type determined by user input
  9
 
  • Defender can adapt to the attacker's pattern of attacks
  13

Part II: GUI (note your grade for this part may be reduced by a point if your solution exhibits bad style conventions): all other marks applies to Part I of the assignment

   
  Default text is changed   2
  Text changes when button is pressed   3
 

Sub total

 

58

       

OVERALL ASSIGNMENT TOTAL (Letter grade)

 

90

Note: maximum score possible if classes/objects are not employed in Part I is C+.

Raw score Letter
86 - 90 A
81 - 85 A-
76 - 80 B+
71 - 75 B
66 - 70 B-
61 - 65 C+
56 - 60 C
51 - 55 C-
46 - 50 D+
26 - 45 D
0 - 25 F