Routine 2


Routine 2 : (ICT) Often called a 'subroutine' or a 'function'. Many computer programs are divided up into smaller parts called 'subroutines' or 'functions'. The main program code calls these subroutines or functions to carry out a specific task - perhaps printing a file and so on. Subroutines often have values passed into them in order to carry out their task and they may also return values. A typical piece of code looks like money = work_out_tax(income, tax_rate); Where the subroutine is 'work_out_tax'. An important difference between a subroutine and a function is that a subroutine can affect global variables whilst functions cannot (should not). So a function carries out a calculation and returns a value x = Cos(y). Just like a calculator a function returns a specific number after pressing any number of function buttons
No records Found
afaatim.com copyright © April 2016 Dr.K.R.Kamaal. All rights reserved