April 2000 QUESTION 5 Total Marks: 15 Marks |
Click here to access other
questions
Click to access |
(a)Consider the function foo the definition of which is given below: (b)Write a function,called SumTotal the signature of which is given
below,which takes a single integer parameter n and returns the sum
total of all the values of n passed to SumTotal in the life of the
program.You should ensure that the initial value of the total is correctly
initialised, and your function may not refer to any global variables. (c)Write a rocedure, called Sort the signature of which is given
below,which takes references to three integers, a b and c On exit,the
three integers should be sorted such that a is the largest, and c
is the smallest.The procedure should also print out the integers in
their sortedorder. |