COMMON FUNCTIONS
The Pascal language provides a range of functions to perform data
transformation and calculations. The following section provides
an explanation of the commonly provided functions,
ABS( -21 ) returns 21 ABS( -3.5) returns 3.5000000000E+00
COS( 0 ) returns 1.0
EXP(10 ) returns e to the power of 10
There is no function in Pascal to calculate expressions such as an, ie,
23 is 2*2*2 = 8
These are calculated by using the formula
an = exp( n * ln( a ) )
rounding is up for fractions greater than or equal to .5 rounding is down for fractions less than .5
If the number is negative
rounding is down (away from zero) for fractions >= .5 rounding is up (towards zero) for fractions
SIN( PI / 2 ) returns 1.0
SQR( 2 ) returns 4
SQRT( 4 ) returns 2.0000000000E+00
TRUNC(4.87) returns 4 TRUNC(-3.4) returns 3
PROGRAM FOURTEEN
Given the following list of wages stored in an array,
210.33 119.78 191.05 222.94
calculate the total breakdown of required coins (ignore
dollars) into 50c, 20c, 10c, 5c, 2c, and 1c pieces.