The completed program is given below:
Here is the completed program:
DIM VALUE(1 TO 5) ' Ask for an array of floating point numbers
'
LET VALUE(1) = 19.234 ' Put 19.234 into the first slot of the array
LET VALUE(2) = -12.6 ' Put -12.6 into the second slot
LET VALUE(3) = 99.85 ' Put 99.85 into the third slot
LET VALUE(1) = -20.08 ' Change the value in the first slot to -20.08
LET VALUE(2) = VALUE(3) ' Make the contents of slot 2 the same as slot 3
PRINT "First slot:", VALUE(1) ' Print out the first slot
PRINT "2nd slot:", VALUE(2) ' Print out the second slot
PRINT "3rd slot:", VALUE(3) ' Print out the third slot
END
The program prints out:
First slot: -20.08 2nd slot: 99.85 3rd slot: 99.85
(Review:) What would happen if the following statement were placed in the program?
PRINT "10th slot:", VALUE(10) ' Print out the tenth slot