Subroutines

Cards (5)

  • What is a Subroutine
    A predefined block of code with a unique name, that can be called at any time by writing its name
  • List the two types of sub-programs
    • Subroutine (no return value)
    • Function (has a return value)
  • What are Parameters
    Input variables needed to create a subroutine
  • What are Arguments
    Input values passed into already created subroutines
  • List the advantages of using subroutines
    • Easier to understand the program
    • Test subroutines in isolation
    • Develop them independently of each other
    • Change one subroutine without affecting the others
    • Easily debugged for errors
    • Allows programmers to develop a whole program together