Page images
PDF
EPUB

**

* * * * * * * * * * * * * * * * * * *

***

**

10 PRINT "PROGRAM FILE 5: THE STOP-STATEMENT."
20 PRINT " ANSI STANDARD 10.2, 10.4"
30 PRINT
40 PRINT "SECTION 5.1: THE STOP-STATEMENT."
50 PRINT
60 PRINT"

BEGIN TEST."
70 PRINT
80 PRINT "IF PROGRAM EXECUTION TERMINATES AFTER THE NEXT LINE,"
90 PRINT " *** TEST PASSED ****
100 STOP
110 PRINT "PROGRAM EXECUTION WAS NOT TERMINATED:"
120 PRINT " *** TEST FAILED ***
130 PRINT
140 PRINT "

END TEST." 150 PRINT 160 PRINT "END PROGRAM 5" 170 END

PROGRAM FILE 5: THE STOP-STATEMENT.

ANSI STANDARD 10.2, 10.4

SECTION 5.1: THE STOP-STATEMENT.

BEGIN TEST.

IF PROGRAM EXECUTION TERMINATES AFTER THE NEXT LINE,

*** TEST PASSED ***

**

10 PRINT "PROGRAM FILE 6: PRINT-SEPARATORS, TABS," 15 PRINT"

AND STRING VARIABLES." 20 PRINT " ANSI STANDARD 6.2, 6.4, 9.2, 9.4, 12.2, 12.4" 30 PRINT 40 PRINT "SECTION 6.1: SEMICOLON SEPARATOR WITH QUOTED STRINGS." 60 PRINT 70 PRINT !

BEGIN TEST." 80 PRINT 90 PRINT "

1. 123" 100 PRINT "

2. 1":"2":"3" 110 PRINT !

3. 1" ; 120 PRINT "23" 130 PRINT "

4. 12" ; 140 PRINT "3" 150 PRINT 11

5. 9" ;

[ocr errors][ocr errors][ocr errors][merged small]

160 PRINT "2" ;
170 PRINT "3"
180 PRINT
190 PRINT **** TEST PASSED IF THERE ARE EXACTLY FIVE NUMBERED LINES"
200 PRINT" ABOVE, EACH CONTAINING THE ADJACENT DIGITS '123', AND"
205 PRINT" IF THEY ARE LINED UP IN A COLUMN ****
210 PRINT
220 PRINT "

END TEST."
380 PRINT
390 PRINT "SECTION 6.2: THE COMMA SEPARATOR WITH QUOTED STRINGS."
410 PRINT
420 PRINT"

BEGIN TEST." 430 PRINT 440 PRINT "THE PRINT LINE SHOULD BE DIVIDED INTO EQUAL ZONES WHICH " 450 PRINT "ENABLE THE COMMA SEPARATOR TO ACT AS A TAB WHEN PRINTING" 460 PRINT "A SERIES OF COMMA-SEPARATED ITEMS." 470 PRINT 480 PRINT "00000000011111111112222222222333333333344444444445"; 490 PRINT "5555555556" 500 PRINT "12345678901234567890123456789012345678901234567890"; 510 PRINT "1234567890" 520 PRINT "XYZ", "XYZ", "XYZ" 530 PRINT 540 PRINT **** TEST PASSED IF 3 SETS OF THE CHARACTERS 'XYZ' ARE EVENLY" 550 PRINT I SPACED ON A SINGLE LINE IN THE ABOVE TEST AND WIDTH" 555 PRINT " OF PRINT ZONE IS AS DOCUMENTED *** 560 PRINT 570 PRINT "

END TEST." 580 PRINT 590 PRINT "SECTION 6.3: TABBING QUOTED STRINGS." 610 PRINT 620 PRINT"

BEGIN TEST." 630 PRINT 640 PRINT "00000000011111111112222222222333333333344444444445"; 650 PRINT "5555555556" 660 PRINT "12345678901234567890123456789012345678901234567890"; 670 PRINT "1234567890" 680 PRINT TAB(24);"1" 690 PRINT TAB( 48);"2" 700 PRINT TAB(59);"3" 710 PRINT 720 PRINT "*** TEST PASSED IF A 'T' IS PRINTED BELOW COLUMN HEADING 24," 730 PRINT " A '2' BELOW 48 AND A '3' BELOW 59 IN THE ABOVE TEST

*** 740 PRINT 750 PRINT "

END TEST." 760 PRINT 770 PRINT "SECTION 6.4: THE ASSIGNMENT OF QUOTED STRINGS." 790 PRINT 800 PRINT"

BEGIN TEST." 810 PRINT 820 PRINT "THIS TEST ASSIGNS THE SAME QUOTED STRING TO ALL LEGAL STRING" 830 PRINT "VARIABLES: A$ THROUGH Z$, USING A SERIES OF LET-STATEMENTS." 840 PRINT "A$ IS ASSIGNED THE QUOTED STRING, THEN B$ IS ASSIGNED A$ 850 PRINT "THROUGH Z$ ASSIGNED Y$." 860 PRINT

[ocr errors][ocr errors][ocr errors][ocr errors]

870 LET A$="18 CHARACTERS LONG"
880 LET B$=A$
890 LET C$-B$
900 LET D$=C$
910 LET E$=D$
920 LET F$=E$
930 LET G$:F$
940 LET H$=G$
950 LET I$=H$
960 LET J$=1$
970 LET K$=J$
980 LET L$=K$
990 LET M$=L$
1000 LET N$=M$
1010 LET 0$=N$
1020 LET P$=0$
1030 LET Q$=P$
1040 LET R$=Q$
1050 LET S$=R$
1060 LET T$S$
1070 LET U$=T$
1080 LET V$=U$
1090 LET W$=V$
1 100 LET X$=W$
1110 LET Y$-X$
1 120 LET Z$-Y$
1130 PRINT

Z$ : ";2$ 1140 PRINT 1150 PRINT **** TEST PASSED IF 'Z$ : 18 CHARACTERS LONG' IS PRINTED" 1160 PRINT IN THE ABOVE TEST ***n 1170 PRINT 1180 PRINT "

END TEST." 1190 PRINT 1200 PRINT "SECTION 6.5: SEMICOLON SEPARATOR WITH ASSIGNED STRINGS" 1210 PRINT"

AND CONSTANTS." 1220 PRINT 1230 PRINT "

BEGIN TEST." 1240 PRINT 1250 LET A$="123" 1260 LET B$="1" 1270 LET C$="2" 1280 LET D$="3" 1290 LET E$="12" 1300 LET F$="23" 1310 PRINT"

1.": A$ 1320 PRINT"

2.":B$;C$;D$ 1330 PRINT "

3.";B$; 1340 PRINT F$ 1350 PRINT "

4.":"12" ; 1360 PRINT D$ 1370 PRINT "

5.";B$; 1380 PRINT "2" ; 1390 PRINT D$ 1400 PRINT

[ocr errors]
[ocr errors]

1410 PRINT "*** TEST PASSED IF THERE ARE EXACTLY FIVE NUMBERED LINES" 1420 PRINT " ABOVE, EACH CONTAINING THE ADJACENT DIGITS '123', AND" 1425 PRINT " IF THEY ARE LINED UP IN A COLUMN *** 1430 PRINT 1440 PRINT "

END TEST." 1450 PRINT 1460 PRINT "SECTION 6.6: COMMA SEPARATOR ASSIGNED STRINGS" 1470 PRINT "

AND CONSTANTS." 1480 PRINT 1490 PRINT "

BEGIN TEST." 1500 PRINT 1510 LET A$="XYZ" 1530 LET C$="XYZ" 1540 PRINT "00000000011111111112222222222333333333344444444445"; 1550 PRINT "5555555556" 1560 PRINT "12345678901234567890123456789012345678901234567890"; 1570 PRINT "1234567890" 1580 PRINT A$, "XYZ", C$ 1590 PRINT 1600 PRINT "*** TEST PASSED IF 3 SETS OF THE CHARACTERS 'XYZ' ARE " 1610 PRINT " EVENLY SPACED ON A SINGLE LINE IN THE ABOVE TEST AND " 1615 PRINT" WIDTH OF PRINT ZONE IS AS DOCUMENTED *** 1620 PRINT 1630 PRINT"

END TEST." 1640 PRINT 1650 PRINT "SECTION 6.7: TABBING ASSIGNED STRINGS AND CONSTANTS." 1670 PRINT 1680 PRINT"

BEGIN TEST." 1690 PRINT 1700 LET A$="1" 1720 LET C$="3" 1730 PRINT "00000000011111111112222222222333333333344444444445"; 1740 PRINT "5555555556" 1750 PRINT "12345678901234567890123456789012345678901234567890"; 1760 PRINT "1234567890" 1770 PRINT TAB(24); A$ 1780 PRINT TAB(48);"2" 1790 PRINT TAB(59);C$ 1800 PRINT 1810 PRINT "*** TEST PASSED IF A '1' PRINTS BELOW COLUMN HEADING 24," 1820 PRINT " A '2' BELOW 48, AND A '3' BELOW 59 1830 PRINT 1840 PRINT "

END TEST." 1850 PRINT 1860 PRINT "SECTION 6.8: NULL PRINT ITEMS." 1870 PRINT 1880 PRINT "THIS TEST DETERMINES WHETHER THE PROCESSOR RECOGNIZES" 1890 PRINT "CONSECUTIVE COMMAS IN A PRINT-STATEMENT AS TAB POSITIONS." 1900 PRINT 1910 PRINT "

BEGIN TEST." 1920 PRINT

1930 PRINT "00000000011111111112222222222333333333344444444445"; 1940 PRINT "5555555556" 1950 PRINT "12345678901234567890123456789012345678901234567890"; 1960 PRINT "1234567890" 1965 PRINT "PRINT-ZONE IDENTIFIERS :" 1970 PRINT "9","2","3", "4" 1980 PRINT ,,,"A" 1990 PRINT 2000 PRINT **** TEST PASSED IF AN 'A' IS IN THE BEGINNING COLUMN OF THE" 2010 PRINT " FOURTH PRINT ZONE FOR THIS SYSTEM

**** 2020 PRINT 2030 PRINT "

END TEST." 2040 PRINT 2050 PRINT "END PROGRAM 6" 2060 END

PROGRAM FILE 6: PRINT-SEPARATORS, TABS,

AND STRING VARIABLES.
ANSI STANDARD 6.2, 6.4, 9.2, 9.4, 12.2, 12.4

.

[ocr errors]

SECTION 6.1: SEMICOLON SEPARATOR WITH QUOTED STRINGS.

BEGIN TEST.

1. 123 2. 123 3. 123 4. 123 5. 123

*** TEST PASSED IF THERE ARE EXACTLY FIVE NUMBERED LINES

ABOVE, EACH CONTAINING THE ADJACENT DIGITS '123', AND
IF THEY ARE LINED UP IN A COLUMN ***

END TEST.

SECTION 6.2: THE COMMA SEPARATOR WITH QUOTED STRINGS.

BEGIN TEST.

THE PRINT LINE SHOULD BE DIVIDED INTO EQUAL ZONES WHICH
ENABLE THE COMMA SEPARATOR TO ACT AS A TAB WHEN PRINTING
A SERIES OF COMMA-SEPARATED ITEMS.

000000000111111111122222222223333333333444444444455555555556
123456789012345678901234567890123456789012345678901234567890
XYZ
XYZ

XYZ

*** TEST PASSED IF 3 SETS OF THE CHARACTERS 'XYZ' ARE EVENLY

SPACED ON A SINGLE LINE IN THE ABOVE TEST AND WIDTH
OF PRINT ZONE IS AS DOCUMENTED ***

END TEST.

« PreviousContinue »