Lecture notes for the Introduction to Computer Science I by James Tam

Return to the course web page

CPSC 231: Assignment 3 (Marking Key)

    Max score

Coding style

 
 
  • Appropriate use of white space (source code)
2
 
  • Self-documenting variable, constant and function names.
4
 
  • No global variables (global constants are OK)
2
 
  • No magic numbers (using named constants instead)
2
 
  • Deep nesting of if statements and loops is avoided (max 3 levels of nesting)
3
 
  • Boolean expressions are simple and easy to read
3
 

Sub total

16

Documentation

 
 
  • Header documentation includes name and tutorial section
1
 
  • Header documentation contains description of program.
2
 
  • In line documentation used for blocks of code
3
 

Sub total

6

Code design

 
 
  • Code contains at least 5 functions. (Half marks if code contains at least 3 functions)
4
 
  • Each function has a single well-defined task
3
 
  • Each function has at most 20 lines of code
3
 
  • Code duplication is minimized
3

 

Sub total

13

Functionality (only qualify for these marks if the program runs)

 
 
  • Prompts for date of birth
1
 
  • Continually re-prompts the user if the birth year is outside the valid range
1
 
  • Continually re-prompts the user if the birth month is outside the valid range
1
 
  • Continually re-prompts the user if the birth day is outside of valid range.
1
 
  • Continually re-prompts the user if the birth day is not valid for the birth month entered by the user.
1
 
  • Gives clear and helpful error messages
2
 
  • Displays a life path number based on input
1
 
  • Displays correct life path number
2
 
  • Correctly reduces numbers to a single digit
4
 
  • Month is correctly reduced to single digit
1
 
  • Day is correctly reduced to single digit
1
 
  • Year is correctly reduced to single digit
1
 
  • Sum of results is reduced correctly to a single digit
1
  Sub total 18
     

OVERALL ASSIGNMENT TOTAL

53