Home   MosaicPresentation format
<http://cnfolio.com/IntroToComputingTopic07Print>
Introduction to Computing – B142L

Functions

Academic year 2011/12



Objectives:
  1. Purpose of functions
  2. Implementation of functions
  3. Practices to use functions






Groups of statements



In which situations would it be useful to organise statements into a group?














Which methods are available to combine multiple statements into a group?














 






Output from functions



Which functions in the standard library produce output values?














What is the syntax term for the output values produced by a function?














How do we define the data type for the output value produced by a function?














How do we use the output value produced by a function?














Is it a requirement to use the output value produced by a function?













Is there a minimum or maximum number of output values produced by a function?













 






Input to functions



Which functions in the standard library require input values?














What is the syntax term for the input values provided to a function?














How do we define the data type for the input values provided to a function?














How do we use the input values provided to a function?














Is it a requirement to use the input values provided to a function?














Is there a minimum or maximum number of input values provided to a function?













 






Structured programming with functions



The operation of a C program could be described as the transfer of control from one function to another function until the main function is finished.

How could we describe that in a graphical manner?














How does a program know whether a function is available (that it exists) or not?














Where are the input and output values for each function in the diagram?












 






Structured programming with functions



Functions permit C programs to be organised and designed for: