10 PRINT "PROGRAM FILE 165: COMPOUND EXPRESSIONS AND PRINT."
20 PRINT "    ANSI STANDARD 7.2, 7.4, 12.2, 12.4"
30 PRINT
40 PRINT "THIS PROGRAM TESTS THE USE OF NUMERIC EXPRESSIONS IN THE"
50 PRINT "CONTEXT OF THE PRINT STATEMENT."
60 PRINT
70 PRINT "SECTION 165.1: NUMERIC EXPRESSIONS AS PRINT ITEMS."
80 PRINT
90 PRINT "                               BEGIN TEST."
100 PRINT
110 DEF FNA(X)=X^2+1
120 LET A1=0.5
130 LET B1=-.25
140 LET C1=16.0
150 LET D1=-4.0
152 FOR I=1 TO 7
153 FOR J=1 TO 7
155 LET Q(I,J)=I/J
156 NEXT J
157 NEXT I
160 PRINT "EXPECTED","CALCULATED"
170 PRINT " VALUES", "  VALUES"
180 PRINT
190 PRINT -.25 ,3*A1+7*B1
200 PRINT  6.5 ,ABS(A1+1.0-(C1+D1)+0.5*8.0)
210 PRINT  16.4794255,SIN(A1^2+ABS(B1))+C1
220 PRINT  1.54192554,FNA(B1+A1)+SIN(A1)
225 PRINT 5.24288566E-22,EXP(-Q(7,1)/Q(1,7))
230 PRINT
240 PRINT "*** TEST PASSED IF THE EXPECTED VALUES AND THE CALCULATED"
250 PRINT "    VALUES ARE NUMERICALLY EQUAL OR APPROXIMATELY SO  ***"
260 PRINT
270 PRINT "                                END TEST."
280 PRINT
290 PRINT "SECTION 165.2: NUMERIC EXPRESSIONS AS ARGUMENTS"
295 PRINT "        TO TAB-CALLS."
300 PRINT
310 PRINT "                               BEGIN TEST."
320 PRINT
330 DEF FNB(X)=X^3-8
340 LET A1=2.75
350 LET B1=1.5
360 LET C1=3.1
370 PRINT "00000000011111111112222222222333333333344444444445";
380 PRINT "5555555556666666666777"
390 PRINT "12345678901234567890123456789012345678901234567890";
400 PRINT "1234567890123456789012"
410 PRINT TAB(2*C1-A1);"A";TAB(2*ABS(-B1)+A1-Q(1,5));"B";
420 PRINT TAB(FNB(A1+B1)-.15);"C"
430 PRINT
440 PRINT "*** TEST PASSED IF THE CHARACTERS 'A', 'B' AND 'C' ARE"
450 PRINT "    PRINTED IN COLUMNS 3, 6, AND 69 RESPECTIVELY  ***"
460 PRINT
470 PRINT "                                 END TEST."
480 PRINT
490 PRINT "END PROGRAM 165"
500 END
