One possible solution to the problem:

! Write a subroutine to exchange or swap two numbers

! that are passed as parameters.

! Test your subroutine using the numbers 0 and 1.

! Test the subroutine using, for example, a test program:

! Test Practice Program 1

! Let A = 5

! Let B = 10

! Print "Before swap, A ="; A; "and B =";B

! CALL Swap (A,B)

! Print "After swap, A ="; A; "and B =";B

! END

 

!Test Practice Program 1

LET A = 0

LET B = 1

SET COLOR "red"

PRINT "Before swap, A ="; A; "and B =";B

CALL Swap (A,B)

SET COLOR "blue"

PRINT "After swap, A ="; A; "and B =";B

END

 

SUB Swap (C,D)

LET temp = C

LET C = D

LET D = temp

SOUND 1000,.1

END SUB

 

Before swap, A = 0 and B = 1

After swap, A = 1 and B = 0