CS105

What is a function?       Why do you need a function?

Scope of the function.   Examples of functions.     



Scope of a Function



When programs are complex or large, a few rules should be used to help keep the them readable and maintainable:
  • The main function should be no more than one page in length.
  • The main function should read like an executive summary of the solution to the problem.
  • Each separate function should be a self contained and independent logical entity.

 

       What is a function?       Why do you need a function?

Scope of the function.   Examples of functions.