3. Commonly executed sections of code - libraries and subroutines

Students Learn About:

  • Commonly executed sections of code
    • reusable code
      • standard logic, such as:
        • a login process
        • data validation
        • conversion between date formats
      • to replace multiple occurrences of the same code
    • combining code from different sources
      • copying and pasting into code
      • calling modules or subroutines
    • making the same data available to different modules 
      • global variables
      • parameter passing
    • use of functions and procedures

Students Learn To:

  • develop standard modules or subroutines for reuse

  • create solutions to problems using existing code with minimal change or additions

  • develop code that makes use of common modules or subroutines

  • differentiate between the scope of local and global variables

  • develop code that makes appropriate use of global and local variables

  • develop code that calls common modules and passes parameters appropriately

  • incorporate functions into modules or subroutines

  • make use of procedures (see Course Specifications document)
    • (see Section 7 of Course Specification for sample algorithm fragment)