The program:

! Write a function Cube that returns the cube of its numeric parameter.

! Test your function using the numbers 2, 5, and 132.

 

DECLARE FUNCTION Cube

DATA 2,5,132

DO while more data

READ x

PRINT "The cube of ";x;" is "; Cube(x)

LOOP

END

 

FUNCTION Cube(y)

LET Cube = y*y*y

END FUNCTION

The output:

The cube of 2 is 8

The cube of 5 is 125

The cube of 132 is 2299968