' BASIC exercise No. 23 'This program contains a SUB called square. The purpose of this SUB 'is to calculate and output the square of a number DECLARE SUB square (x!) square 50 square 80 '1. Add extra instructions to print out the square of other numbers '2. Look at the SUB called square and see how it works. '3. Create a new SUB called "cube" that will output the cube of a number SUB square (x) 'The number after the word "square" in the main program 'is stored in the variable in brackets (x in this case). LET y x^2 'instead of specifying an actual number in the PRINT "The square is";y 'calculation the variable 'x' is used instead. This 'way the square can be of any number. The variable in 'brackets is called a "parameter" and giving it a value END SUB 'when calling the SUB is called "parameter passing".