Page images
PDF
EPUB

SECTION 6.3: TABBING QUOTED STRINGS.

BEGIN TEST.

000000000111111111122222222223333333333444444444455555555556 123456789012345678901234567890123456789012345678901234567890 1

2

3

*** TEST PASSED IF A '1' IS PRINTED BELOW COLUMN HEADING 24,

A '2' BELOW 48 AND A '3' BELOW 59 IN THE ABOVE TEST ***

END TEST.

SECTION 6.4: THE ASSIGNMENT OF QUOTED STRINGS.

BEGIN TEST.

THIS TEST ASSIGNS THE SAME QUOTED STRING TO ALL LEGAL STRING
VARIABLES: A$ THROUGH 2$, USING A SERIES OF LET-STATEMENTS.
A$ IS ASSIGNED THE QUOTED STRING, THEN B$ IS ASSIGNED A$ ...
THROUGH Z$ ASSIGNED Y$.

Z$ = 18 CHARACTERS LONG

*** TEST PASSED IF '2$ = 18 CHARACTERS LONG' IS PRINTED IN THE ABOVE TEST

***

END TEST.

SECTION 6.5: SEMICOLON SEPARATOR WITH ASSIGNED STRINGS

AND CONSTANTS.

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.6: COMMA SEPARATOR - ASSIGNED STRINGS

AND CONSTANTS.

BEGIN TEST.

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.

SECTION 6.7: TABBING ASSIGNED STRINGS AND CONSTANTS.

BEGIN TEST.

000000000111111111122222222223333333333444444444455555555556 123456789012345678901234567890123456789012345678901234567890 1

2

3

[ocr errors]

*** TEST PASSED IF A 'q' PRINTS BELOW COLUMN HEADING 24,

A '2' BELOW 48, AND A '3' BELOW 59

***

END TEST.

SECTION 6.8: NULL PRINT ITEMS.

THIS TEST DETERMINES WHETHER THE PROCESSOR RECOGNIZES CONSECUTIVE COMMAS IN A PRINT-STATEMENT AS TAB POSITIONS.

[merged small][ocr errors]

000000000111111111122222222223333333333444444444455555555556 123456789012345678901234567890123456789012345678901234567890 PRINT-ZONE IDENTIFIERS: 1 2 3

4 A

*** TEST PASSED IF AN 'A' IS IN THE BEGINNING COLUMN OF THE FOURTH PRINT ZONE FOR THIS SYSTEM

***

END TEST.

END PROGRAM 6

10 PRINT "PROGRAM FILE 7: EXCEPTION - STRING OVERFLOW USING" 15 PRINT

THE LET-STATEMENT." 20 PRINT " ANSI STANDARD 9.5, 12.4" 30 PRINT

[ocr errors]
[ocr errors]

40 PRINT "SECTION 7.1: EXCEPTION - STRING OVERFLOW USING" 50 PRINT "

THE LET-STATEMENT." 60 PRINT 70 PRINT "STRING OVERFLOW OCCURS WHEN THE VALUE ASSIGNED TO A STRING" 80 PRINT "VARIABLE CONTAINS MORE CHARACTERS THAN CAN BE RETAINED." 82 PRINT 85 PRINT "TO PASS THIS TEST:" 90 PRINT 95 PRINT " 1) A MESSAGE IDENTIFYING THE EXCEPTION MUST BE" 100 PRINT

DISPLAYED AND EXECUTION MUST TERMINATE, OR" 105 PRINT 110 PRINT 2) STRING OVERFLOW MUST NOT OCCUR" 120 PRINT 130 PRINT"

BEGIN TEST." 140 PRINT 145 PRINT "ABOUT TO ASSIGN STRING OF 19 CHARACTERS 150 LET A$="?*******19********!" 155 PRINT "ABOUT TO ASSIGN STRING OF 20 CHARACTERS 160 LET B$="?********20********!" 165 PRINT "ABOUT TO ASSIGN STRING OF 30 CHARACTERS 170 LET C$="?*************30*************!"

! 175 PRINT "ABOUT TO ASSIGN STRING OF 40 CHARACTERS 180 LET D$="?******************40******************!"

! 185 PRINT "ABOUT TO ASSIGN STRING OF 50 CHARACTERS 190 LET E$="?******* **********50**********

!" 195 PRINT "ABOUT TO ASSIGN STRING OF 58 CHARACTERS - " 200 LET F$="?********** *************58**** 202 PRINT "ALL ASSIGNMENTS COMPLETED." 205 PRINT 210 PRINT "?*******19******** ! 220 PRINT A$ 230 PRINT 240 PRINT "?********20********!" 250 PRINT B$ 260 PRINT 270 PRINT "?*! 280 PRINT C$ 290 PRINT 300 PRINT "?**?

*40 310 PRINT D$ 320 PRINT 330 PRINT "?******

**50*

***!" 340 PRINT E$ 350 PRINT 360 PRINT "?***

*58**

*******!" 370 PRINT F$ 380 PRINT 390 PRINT "IF THE PAIRED LINES IN THE OUTPUT ARE IDENTICAL AND EACH" 400 PRINT " LINE STARTS WITH A QUESTION MARK AND ENDS WITH AN" 410 PRINT " EXCLAMATION POINT, THEN" 420 PRINT "*** TEST PASSED ***11 440 PRINT 450 PRINT"

END TEST."

[ocr errors]

*30*:

460 PRINT
470 PRINT "END PROGRAM 7"
480 END

PROGRAM FILE 7: EXCEPTION STRING OVERFLOW USING

THE LET-STATEMENT. ANSI STANDARD 9.5, 12.4

SECTION 7.1: EXCEPTION - STRING OVERFLOW USING

THE LET-STATEMENT.

STRING OVERFLOW OCCURS WHEN THE VALUE ASSIGNED TO A STRING
VARIABLE CONTAINS MORE CHARACTERS THAN CAN BE RETAINED.

TO PASS THIS TEST:

1) A MESSAGE IDENTIFYING THE EXCEPTION MUST BE

DISPLAYED AND EXECUTION MUST TERMINATE, OR

[blocks in formation]
[ocr errors]

1) A MESSAGE IDENTIFYING THE EXCEPTIONS MUST BE"

DISPLAYED, AND"

[ocr errors]

65 PRINT 70 PRINT 75 PRINT 80 PRINT 85 PRINT 90 PRINT 100 PRINT

11

2) THE ARGUMENT TO TAB MUST BE REPLACED WITH A"

VALUE OF ONE AND EXECUTION CONTINUES."

[ocr errors]

110 PRINT "SECTION 8.1: TAB ARGUMENT IS 0."

120 PRINT 130 PRINT 140 PRINT

BEGIN TEST."

145 LET A=0 150 PRINT "00000000011111111112222222222333333333344444444445"; 160 PRINT "5555555556" 170 PRINT "12345678901234567890123456789012345678901234567890"; 180 PRINT "1234567890" 190 PRINT TAB(A);"X" 200 PRINT 210 PRINT "*** TEST PASSED IF AN X IS PRINTED IN COLUMN 1, AFTER A " 220 PRINT" SYSTEM MESSAGE IDENTIFYING THE EXCEPTION 230 PRINT 240 PRINT"

END TEST." 250 PRINT 260 PRINT "SECTION 8.2: TAB ARGUMENT IS NEGATIVE." 270 PRINT 280 PRINT "

BEGIN TEST." 290 PRINT 295 LET A:-10 300 PRINT "00000000011111111112222222222333333333344444444445"; 310 PRINT "5555555556" 320 PRINT "12345678901234567890123456789012345678901234567890"; 330 PRINT "1234567890" 340 PRINT TAB(A);"X" 350 PRINT 360 PRINT "*** TEST PASSED IF AN X IS PRINTED IN COLUMN 1, AFTER A" 370 PRINT" SYSTEM MESSAGE IDENTIFYING THE EXCEPTION

### 380 PRINT 390 PRINT

END TEST." 400 PRINT 430 PRINT 440 PRINT "SECTION 8.3: ROUNDED TAB ARGUMENT EQUAL TO ONE." 450 PRINT 460 PRINT

BEGIN TEST." 470 PRINT 475 LET A:.6 480 PRINT "00000000011111111112222222222333333333344444444445"; 490 PRINT "5555555556" 500 PRINT "12345678901234567890123456789012345678901234567890"; 510 PRINT "1234567890" 530 PRINT TAB(A);"X" 540 PRINT 550 PRINT **** TEST PASSED IF AN X IS PRINTED IN COLUMN 1 " 555 PRINT " AND NO EXCEPTION REPORTED **** 560 PRINT 570 PRINT"

END TEST." 580 PRINT 590 PRINT "SECTION 8.4: FRACTIONAL TAB ARGUMENT LESS THAN ONE AFTER" 600 PRINT"

ROUNDING." 610 PRINT 620 PRINT "

BEGIN TEST." 630 PRINT

« PreviousContinue »