home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / BASIC / BASMAN1.ARC / CHAP2.DOC < prev    next >
Unknown  |  1987-12-12  |  21.5 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
1% dexvert WANG Integrated Word Processor (document/wangIWP) ext Unsupported
1% dexvert Dynamic Publisher Document (document/dynamicPublisherDocument) ext Unsupported
1% dexvert Excellence! Document (document/excellenceDocument) ext Unsupported
1% dexvert Norton Textra Writer (document/textraWriter) ext Unsupported
1% dexvert IBM DisplayWrite Document (document/ibmDisplayWriteDocument) ext Unsupported
100% file data default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 1b 32 1b 55 00 1b 36 1b | 38 1b 41 0c 1b 32 1b 47 |.2.U..6.|8.A..2.G|
|00000010| 1b 43 42 0d 0a 0d 0a 0d | 0a 0d 0a 20 20 20 20 20 |.CB.....|... |
|00000020| 1b 45 43 48 41 50 54 45 | 52 20 32 1b 46 20 20 20 |.ECHAPTE|R 2.F |
|00000030| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 1b 45 | | .E|
|00000040| 20 55 53 45 46 55 4c 20 | 50 52 4f 47 52 41 4d 4d | USEFUL |PROGRAMM|
|00000050| 49 4e 47 1b 46 20 20 1b | 45 20 1b 46 20 20 20 20 |ING.F .|E .F |
|00000060| 20 20 20 20 20 20 20 20 | 20 20 20 1b 45 43 48 41 | | .ECHA|
|00000070| 50 54 45 52 20 32 0d 0a | 0d 0a 0d 0a 20 20 20 20 |PTER 2..|.... |
|00000080| 20 4c 4f 4f 50 49 4e 47 | 0d 0a 0d 0a 20 20 20 20 | LOOPING|.... |
|00000090| 20 1b 46 49 6e 20 74 68 | 65 20 70 72 65 76 69 6f | .FIn th|e previo|
|000000a0| 75 73 20 63 68 61 70 74 | 65 72 20 79 6f 75 20 77 |us chapt|er you w|
|000000b0| 72 6f 74 65 20 79 6f 75 | 72 20 66 69 72 73 74 20 |rote you|r first |
|000000c0| 70 72 6f 67 72 61 6d 2e | 20 20 4c 65 74 27 73 20 |program.| Let's |
|000000d0| 61 64 64 20 6d 6f 72 65 | 0d 0a 20 20 20 20 20 64 |add more|.. d|
|000000e0| 61 74 61 20 74 6f 20 69 | 74 3a 0d 0a 0d 0a 20 20 |ata to i|t:.... |
|000000f0| 20 20 20 31 30 30 20 52 | 45 41 44 20 20 4c 41 53 | 100 R|EAD LAS|
|00000100| 54 2e 4e 41 4d 45 24 2c | 20 46 49 52 53 54 2e 4e |T.NAME$,| FIRST.N|
|00000110| 41 4d 45 24 2c 20 41 47 | 45 0d 0a 20 20 20 20 20 |AME$, AG|E.. |
|00000120| 31 31 30 20 50 52 49 4e | 54 20 4c 41 53 54 2e 4e |110 PRIN|T LAST.N|
|00000130| 41 4d 45 24 2c 20 46 49 | 52 53 54 2e 4e 41 4d 45 |AME$, FI|RST.NAME|
|00000140| 24 2c 20 41 47 45 0d 0a | 20 20 20 20 20 31 32 30 |$, AGE..| 120|
|00000150| 20 44 41 54 41 20 4a 4f | 4e 45 53 2c 46 52 45 44 | DATA JO|NES,FRED|
|00000160| 2c 31 39 0d 0a 20 20 20 | 20 20 31 33 30 20 44 41 |,19.. | 130 DA|
|00000170| 54 41 20 4d 49 4c 4c 45 | 52 2c 48 45 52 4d 41 4e |TA MILLE|R,HERMAN|
|00000180| 2c 33 34 0d 0a 20 20 20 | 20 20 31 34 30 20 44 41 |,34.. | 140 DA|
|00000190| 54 41 20 45 4f 46 2c 58 | 58 58 2c 30 0d 0a 20 20 |TA EOF,X|XX,0.. |
|000001a0| 20 20 20 31 35 30 20 53 | 54 4f 50 0d 0a 20 20 20 | 150 S|TOP.. |
|000001b0| 20 20 31 36 30 20 45 4e | 44 0d 0a 0d 0a 20 20 20 | 160 EN|D.... |
|000001c0| 20 20 55 6e 66 6f 72 74 | 75 6e 61 74 65 6c 79 2c | Unfort|unately,|
|000001d0| 20 77 68 65 6e 20 74 68 | 65 20 70 72 6f 67 72 61 | when th|e progra|
|000001e0| 6d 20 65 78 65 63 75 74 | 65 73 2c 20 74 68 65 20 |m execut|es, the |
|000001f0| 6f 75 74 70 75 74 20 63 | 6f 6e 73 69 73 74 73 20 |output c|onsists |
|00000200| 6f 66 20 6f 6e 6c 79 0d | 0a 20 20 20 20 20 6f 6e |of only.|. on|
|00000210| 65 20 6c 69 6e 65 2c 0d | 0a 0d 0a 20 20 20 20 20 |e line,.|... |
|00000220| 4a 4f 4e 45 53 20 20 20 | 20 20 20 20 20 20 20 20 |JONES | |
|00000230| 46 52 45 44 20 20 20 20 | 20 20 20 20 20 20 20 31 |FRED | 1|
|00000240| 39 0d 0a 0d 0a 20 20 20 | 20 20 57 68 79 3f 20 20 |9.... | Why? |
|00000250| 53 69 6d 70 6c 65 2c 20 | 74 68 65 20 52 45 41 44 |Simple, |the READ|
|00000260| 20 69 6e 73 74 72 75 63 | 74 69 6f 6e 20 6f 6e 20 | instruc|tion on |
|00000270| 6c 69 6e 65 20 31 30 30 | 20 69 73 20 6f 6e 6c 79 |line 100| is only|
|00000280| 20 63 61 72 72 69 65 64 | 20 6f 75 74 20 6f 6e 65 | carried| out one|
|00000290| 0d 0a 20 20 20 20 20 74 | 69 6d 65 2e 20 20 57 65 |.. t|ime. We|
|000002a0| 20 6e 65 76 65 72 20 74 | 6f 6c 64 20 42 41 53 49 | never t|old BASI|
|000002b0| 43 20 74 68 61 74 20 77 | 65 20 77 61 6e 74 65 64 |C that w|e wanted|
|000002c0| 20 74 6f 20 67 6f 20 62 | 61 63 6b 20 61 6e 64 20 | to go b|ack and |
|000002d0| 72 65 61 64 20 6d 6f 72 | 65 0d 0a 20 20 20 20 20 |read mor|e.. |
|000002e0| 64 61 74 61 2e 20 20 4f | 75 72 20 6e 65 78 74 20 |data. O|ur next |
|000002f0| 74 61 73 6b 20 69 73 20 | 74 6f 20 6d 61 6b 65 20 |task is |to make |
|00000300| 74 68 65 20 6c 6f 67 69 | 63 20 6c 6f 6f 70 20 62 |the logi|c loop b|
|00000310| 61 63 6b 2c 20 72 65 61 | 64 2c 20 61 6e 64 20 70 |ack, rea|d, and p|
|00000320| 72 6f 63 65 73 73 0d 0a | 20 20 20 20 20 61 6c 6c |rocess..| all|
|00000330| 20 74 68 65 20 69 6e 70 | 75 74 20 72 65 63 6f 72 | the inp|ut recor|
|00000340| 64 73 2e 20 20 54 68 65 | 72 65 20 61 72 65 20 73 |ds. The|re are s|
|00000350| 65 76 65 72 61 6c 20 77 | 61 79 73 20 69 6e 20 77 |everal w|ays in w|
|00000360| 68 69 63 68 20 74 68 69 | 73 20 63 61 6e 20 62 65 |hich thi|s can be|
|00000370| 0d 0a 20 20 20 20 20 64 | 6f 6e 65 2c 20 73 6f 6d |.. d|one, som|
|00000380| 65 20 61 20 6c 6f 74 20 | 62 65 74 74 65 72 20 74 |e a lot |better t|
|00000390| 68 61 6e 20 6f 74 68 65 | 72 73 2e 20 20 4f 6e 65 |han othe|rs. One|
|000003a0| 20 77 61 79 20 69 73 20 | 74 68 72 6f 75 67 68 20 | way is |through |
|000003b0| 74 68 65 20 75 73 65 20 | 6f 66 20 61 0d 0a 20 20 |the use |of a.. |
|000003c0| 20 20 20 47 4f 54 4f 20 | 69 6e 73 74 72 75 63 74 | GOTO |instruct|
|000003d0| 69 6f 6e 2c 20 61 6e 20 | 6f 6c 64 20 42 41 53 49 |ion, an |old BASI|
|000003e0| 43 20 63 6f 6d 6d 61 6e | 64 20 74 68 61 74 20 6c |C comman|d that l|
|000003f0| 65 74 73 20 79 6f 75 20 | 73 6b 69 70 20 74 6f 20 |ets you |skip to |
|00000400| 61 6e 79 20 6c 69 6e 65 | 0d 0a 20 20 20 20 20 6e |any line|.. n|
|00000410| 75 6d 62 65 72 2e 20 20 | 41 76 6f 69 64 20 69 74 |umber. |Avoid it|
|00000420| 20 77 68 65 6e 20 70 6f | 73 73 69 62 6c 65 20 61 | when po|ssible a|
|00000430| 73 20 69 74 20 63 61 6e | 20 72 65 73 75 6c 74 20 |s it can| result |
|00000440| 69 6e 20 70 72 6f 67 72 | 61 6d 73 20 77 68 6f 73 |in progr|ams whos|
|00000450| 65 0d 0a 20 20 20 20 20 | 6c 6f 67 69 63 20 69 73 |e.. |logic is|
|00000460| 20 72 65 61 6c 6c 79 20 | 68 61 72 64 20 74 6f 20 | really |hard to |
|00000470| 66 6f 6c 6c 6f 77 2e 0d | 0a 0d 0a 20 20 20 20 20 |follow..|... |
|00000480| 4e 65 77 65 72 20 76 65 | 72 73 69 6f 6e 73 20 6f |Newer ve|rsions o|
|00000490| 66 20 42 41 53 49 43 20 | 6c 69 6b 65 20 42 41 53 |f BASIC |like BAS|
|000004a0| 49 43 41 20 68 61 76 65 | 20 6d 75 63 68 20 62 65 |ICA have| much be|
|000004b0| 74 74 65 72 20 74 6f 6f | 6c 73 20 61 76 61 69 6c |tter too|ls avail|
|000004c0| 61 62 6c 65 2e 0d 0a 20 | 20 20 20 20 57 65 20 61 |able... | We a|
|000004d0| 72 65 20 67 6f 69 6e 67 | 20 74 6f 20 77 6f 72 6b |re going| to work|
|000004e0| 20 77 69 74 68 20 6f 6e | 65 20 6f 66 20 74 68 65 | with on|e of the|
|000004f0| 73 65 2c 20 74 68 65 20 | 57 48 49 4c 45 2f 57 45 |se, the |WHILE/WE|
|00000500| 4e 44 2c 20 74 6f 20 63 | 72 65 61 74 65 20 61 0d |ND, to c|reate a.|
|00000510| 0a 20 20 20 20 20 6c 6f | 6f 70 2e 0d 0a 0d 0a 20 |. lo|op..... |
|00000520| 20 20 20 20 31 30 30 20 | 52 45 41 44 20 4c 41 53 | 100 |READ LAS|
|00000530| 54 2e 4e 41 4d 45 24 2c | 20 46 49 52 53 54 2e 4e |T.NAME$,| FIRST.N|
|00000540| 41 4d 45 24 2c 20 41 47 | 45 0d 0a 20 20 20 20 20 |AME$, AG|E.. |
|00000550| 31 31 30 20 27 0d 0a 20 | 20 20 20 20 31 32 30 20 |110 '.. | 120 |
|00000560| 57 48 49 4c 45 20 4c 41 | 53 54 2e 4e 41 4d 45 24 |WHILE LA|ST.NAME$|
|00000570| 20 3c 3e 20 22 45 4f 46 | 22 0d 0a 20 20 20 20 20 | <> "EOF|".. |
|00000580| 31 33 30 20 20 20 20 50 | 52 49 4e 54 20 4c 41 53 |130 P|RINT LAS|
|00000590| 54 2e 4e 41 4d 45 24 2c | 20 46 49 52 53 54 2e 4e |T.NAME$,| FIRST.N|
|000005a0| 41 4d 45 24 2c 20 41 47 | 45 0d 0a 20 20 20 20 20 |AME$, AG|E.. |
|000005b0| 31 34 30 20 20 20 20 52 | 45 41 44 20 20 4c 41 53 |140 R|EAD LAS|
|000005c0| 54 2e 4e 41 4d 45 24 2c | 20 46 49 52 53 54 2e 4e |T.NAME$,| FIRST.N|
|000005d0| 41 4d 45 24 2c 20 41 47 | 45 0d 0a 20 20 20 20 20 |AME$, AG|E.. |
|000005e0| 31 35 30 20 57 45 4e 44 | 0d 0a 20 20 20 20 20 31 |150 WEND|.. 1|
|000005f0| 36 30 20 27 0d 0a 20 20 | 20 20 20 31 37 30 20 44 |60 '.. | 170 D|
|00000600| 41 54 41 20 4a 4f 4e 45 | 53 2c 46 52 45 44 2c 31 |ATA JONE|S,FRED,1|
|00000610| 39 0d 0a 20 20 20 20 20 | 31 38 30 20 44 41 54 41 |9.. |180 DATA|
|00000620| 20 4d 49 4c 4c 45 52 2c | 48 45 52 4d 41 4e 2c 33 | MILLER,|HERMAN,3|
|00000630| 34 0d 0a 20 20 20 20 20 | 31 39 30 20 44 41 54 41 |4.. |190 DATA|
|00000640| 20 45 4f 46 2c 58 58 58 | 2c 30 0d 0a 20 20 20 20 | EOF,XXX|,0.. |
|00000650| 20 32 30 30 20 53 54 4f | 50 0d 0a 20 20 20 20 20 | 200 STO|P.. |
|00000660| 32 31 30 20 45 4e 44 0d | 0a 0d 0a 20 20 20 20 20 |210 END.|... |
|00000670| 4c 6f 6f 6b 73 20 61 20 | 6c 6f 74 20 6c 69 6b 65 |Looks a |lot like|
|00000680| 20 74 68 65 20 63 6f 64 | 65 20 61 74 20 74 68 65 | the cod|e at the|
|00000690| 20 65 6e 64 20 6f 66 20 | 74 68 65 20 6c 61 73 74 | end of |the last|
|000006a0| 20 63 68 61 70 74 65 72 | 2c 20 64 6f 65 73 6e 27 | chapter|, doesn'|
|000006b0| 74 20 69 74 3f 0d 0a 20 | 20 20 20 20 4c 65 74 27 |t it?.. | Let'|
|000006c0| 73 20 73 65 65 20 68 6f | 77 20 69 74 20 77 6f 72 |s see ho|w it wor|
|000006d0| 6b 73 2e 20 20 54 68 65 | 20 6c 6f 6f 70 20 73 74 |ks. The| loop st|
|000006e0| 61 72 74 73 20 6f 6e 20 | 6c 69 6e 65 20 31 32 30 |arts on |line 120|
|000006f0| 20 77 69 74 68 20 74 68 | 65 20 57 48 49 4c 45 0d | with th|e WHILE.|
|00000700| 0a 20 20 20 20 20 73 74 | 61 74 65 6d 65 6e 74 20 |. st|atement |
|00000710| 61 6e 64 20 65 6e 64 73 | 20 6f 6e 20 6c 69 6e 65 |and ends| on line|
|00000720| 20 31 35 30 20 77 69 74 | 68 20 74 68 65 20 57 45 | 150 wit|h the WE|
|00000730| 4e 44 20 73 74 61 74 65 | 6d 65 6e 74 2e 20 20 56 |ND state|ment. V|
|00000740| 69 73 75 61 6c 6c 79 2c | 20 74 68 69 73 0d 0a 20 |isually,| this.. |
|00000750| 20 20 20 20 73 74 61 6e | 64 73 20 6f 75 74 20 62 | stan|ds out b|
|00000760| 65 63 61 75 73 65 20 61 | 6c 6c 20 74 68 65 20 6c |ecause a|ll the l|
|00000770| 69 6e 65 73 20 62 65 74 | 77 65 65 6e 20 74 68 65 |ines bet|ween the|
|00000780| 73 65 20 74 77 6f 20 73 | 74 61 74 65 6d 65 6e 74 |se two s|tatement|
|00000790| 73 20 68 61 76 65 20 62 | 65 65 6e 0d 0a 20 20 20 |s have b|een.. |
|000007a0| 20 20 69 6e 64 65 6e 74 | 65 64 2e 20 20 59 6f 75 | indent|ed. You|
|000007b0| 20 68 61 76 65 20 74 6f | 20 64 6f 20 74 68 65 20 | have to| do the |
|000007c0| 69 6e 64 65 6e 74 69 6e | 67 2c 20 62 75 74 20 69 |indentin|g, but i|
|000007d0| 74 20 70 61 79 73 20 6f | 66 66 20 69 6e 20 72 65 |t pays o|ff in re|
|000007e0| 61 64 61 62 69 6c 69 74 | 79 0d 0a 20 20 20 20 20 |adabilit|y.. |
|000007f0| 61 6e 64 20 69 6e 20 6d | 61 69 6e 74 61 69 6e 69 |and in m|aintaini|
|00000800| 6e 67 20 74 68 65 20 63 | 6f 64 65 2e 0d 0a 0d 0a |ng the c|ode.....|
|00000810| 0d 0a 0d 0a 0d 0a 0d 0a | 20 20 20 20 20 20 20 20 |........| |
|00000820| 20 20 20 20 20 20 20 20 | 20 1b 45 20 20 20 20 20 | | .E |
|00000830| 20 20 20 20 20 20 20 20 | 20 20 20 1b 46 20 20 20 | | .F |
|00000840| 20 20 1b 45 20 20 31 33 | 0d 0a 0d 0a 0c 0d 0a 0d | .E 13|........|
|00000850| 0a 0d 0a 0d 0a 1b 46 20 | 20 20 20 20 1b 45 43 48 |......F | .ECH|
|00000860| 41 50 54 45 52 20 32 1b | 46 20 20 20 20 20 20 20 |APTER 2.|F |
|00000870| 20 20 20 20 20 20 20 20 | 20 20 1b 45 20 55 53 45 | | .E USE|
|00000880| 46 55 4c 20 50 52 4f 47 | 52 41 4d 4d 49 4e 47 1b |FUL PROG|RAMMING.|
|00000890| 46 20 20 1b 45 20 1b 46 | 20 20 20 20 20 20 20 20 |F .E .F| |
|000008a0| 20 20 20 20 20 20 20 1b | 45 43 48 41 50 54 45 52 | .|ECHAPTER|
|000008b0| 20 32 0d 0a 0d 0a 0d 0a | 20 20 20 20 20 49 4d 42 | 2......| IMB|
|000008c0| 45 44 44 45 44 20 44 4f | 43 55 4d 45 4e 54 41 54 |EDDED DO|CUMENTAT|
|000008d0| 49 4f 4e 0d 0a 0d 0a 20 | 20 20 20 20 1b 46 4e 6f |ION.... | .FNo|
|000008e0| 74 65 20 74 68 65 20 73 | 69 6e 67 6c 65 20 61 70 |te the s|ingle ap|
|000008f0| 6f 73 74 72 6f 70 68 65 | 20 69 6e 20 6c 69 6e 65 |ostrophe| in line|
|00000900| 73 20 31 31 30 20 61 6e | 64 20 31 36 30 2e 20 20 |s 110 an|d 160. |
|00000910| 49 74 20 63 61 6e 20 62 | 65 20 75 73 65 64 20 62 |It can b|e used b|
|00000920| 79 0d 0a 20 20 20 20 20 | 69 74 73 65 6c 66 20 74 |y.. |itself t|
|00000930| 6f 20 73 65 67 6d 65 6e | 74 20 74 68 65 20 70 72 |o segmen|t the pr|
|00000940| 6f 67 72 61 6d 2c 20 6f | 72 20 79 6f 75 20 63 61 |ogram, o|r you ca|
|00000950| 6e 20 65 6e 74 65 72 20 | 72 65 6d 61 72 6b 73 20 |n enter |remarks |
|00000960| 61 66 74 65 72 20 69 74 | 20 74 6f 0d 0a 20 20 20 |after it| to.. |
|00000970| 20 20 65 78 70 6c 61 69 | 6e 20 74 68 65 20 6e 65 | explai|n the ne|
|00000980| 78 74 20 70 69 65 63 65 | 20 6f 66 20 63 6f 64 65 |xt piece| of code|
|00000990| 2e 20 20 59 6f 75 72 20 | 63 6f 64 65 20 69 73 20 |. Your |code is |
|000009a0| 6e 6f 77 20 73 65 6c 66 | 2d 64 6f 63 75 6d 65 6e |now self|-documen|
|000009b0| 74 69 6e 67 2e 20 20 54 | 68 65 0d 0a 20 20 20 20 |ting. T|he.. |
|000009c0| 20 27 20 61 6e 64 20 61 | 6e 79 74 68 69 6e 67 20 | ' and a|nything |
|000009d0| 74 68 61 74 20 66 6f 6c | 6c 6f 77 73 20 77 69 6c |that fol|lows wil|
|000009e0| 6c 20 62 65 20 69 67 6e | 6f 72 65 64 20 62 79 20 |l be ign|ored by |
|000009f0| 42 41 53 49 43 2e 20 20 | 4d 6f 72 65 20 6f 6e 20 |BASIC. |More on |
|00000a00| 74 68 69 73 0d 0a 20 20 | 20 20 20 6c 61 74 65 72 |this.. | later|
|00000a10| 2e 0d 0a 0d 0a 0d 0a 20 | 20 20 20 20 1b 45 57 48 |....... | .EWH|
|00000a20| 49 4c 45 2f 57 45 4e 44 | 0d 0a 0d 0a 20 20 20 20 |ILE/WEND|.... |
|00000a30| 20 1b 46 54 68 65 20 69 | 6e 73 74 72 75 63 74 69 | .FThe i|nstructi|
|00000a40| 6f 6e 20 74 68 61 74 20 | 6d 65 61 6e 73 20 73 6f |on that |means so|
|00000a50| 6d 65 74 68 69 6e 67 20 | 69 73 20 74 68 65 20 57 |mething |is the W|
|00000a60| 48 49 4c 45 2e 20 20 49 | 6e 20 63 6f 6d 70 75 74 |HILE. I|n comput|
|00000a70| 65 72 65 73 65 2c 20 74 | 68 65 0d 0a 20 20 20 20 |erese, t|he.. |
|00000a80| 20 73 70 65 63 69 66 69 | 63 20 6d 65 73 73 61 67 | specifi|c messag|
|00000a90| 65 20 69 73 20 22 61 20 | 6c 6f 6f 70 20 73 74 61 |e is "a |loop sta|
|00000aa0| 72 74 73 20 68 65 72 65 | 22 2e 20 20 54 68 65 20 |rts here|". The |
|00000ab0| 57 45 4e 44 20 73 74 61 | 74 65 6d 65 6e 74 20 74 |WEND sta|tement t|
|00000ac0| 65 72 6d 69 6e 61 74 65 | 73 0d 0a 20 20 20 20 20 |erminate|s.. |
|00000ad0| 74 68 65 20 6c 6f 6f 70 | 2e 20 20 49 74 20 74 72 |the loop|. It tr|
|00000ae0| 61 6e 73 6c 61 74 65 73 | 20 74 6f 20 22 68 65 72 |anslates| to "her|
|00000af0| 65 27 73 20 74 68 65 20 | 65 6e 64 20 6f 66 20 74 |e's the |end of t|
|00000b00| 68 65 20 6c 6f 6f 70 2c | 20 67 6f 20 62 61 63 6b |he loop,| go back|
|00000b10| 20 74 6f 20 74 68 65 0d | 0a 20 20 20 20 20 57 48 | to the.|. WH|
|00000b20| 49 4c 45 20 74 68 61 74 | 20 73 74 61 72 74 65 64 |ILE that| started|
|00000b30| 20 69 74 2e 22 20 20 53 | 6f 20 6d 75 63 68 20 66 | it." S|o much f|
|00000b40| 6f 72 20 74 68 65 20 62 | 65 67 69 6e 6e 69 6e 67 |or the b|eginning|
|00000b50| 20 61 6e 64 20 74 68 65 | 20 65 6e 64 2c 20 68 65 | and the| end, he|
|00000b60| 72 65 27 73 0d 0a 20 20 | 20 20 20 74 68 65 20 72 |re's.. | the r|
|00000b70| 65 73 74 20 6f 66 20 74 | 68 65 20 73 74 6f 72 79 |est of t|he story|
|00000b80| 20 28 73 68 61 64 65 73 | 20 6f 66 20 50 61 75 6c | (shades| of Paul|
|00000b90| 20 48 61 72 76 65 79 29 | 2e 20 20 54 68 65 20 6f | Harvey)|. The o|
|00000ba0| 62 76 69 6f 75 73 20 71 | 75 65 73 74 69 6f 6e 20 |bvious q|uestion |
|00000bb0| 69 73 0d 0a 20 20 20 20 | 20 68 6f 77 20 6c 6f 6e |is.. | how lon|
|00000bc0| 67 20 64 6f 65 73 20 74 | 68 65 20 6c 6f 6f 70 20 |g does t|he loop |
|00000bd0| 6c 6f 6f 70 3f 20 20 4c | 6f 6f 6b 20 61 74 20 74 |loop? L|ook at t|
|00000be0| 68 65 20 70 72 6f 67 72 | 61 6d 20 6f 6e 20 74 68 |he progr|am on th|
|00000bf0| 65 20 70 72 65 76 69 6f | 75 73 20 70 61 67 65 0d |e previo|us page.|
|00000c00| 0a 20 20 20 20 20 61 6e | 64 20 74 61 6b 65 20 79 |. an|d take y|
|00000c10| 6f 75 72 20 62 65 73 74 | 20 67 75 65 73 73 2e 0d |our best| guess..|
|00000c20| 0a 0d 0a 20 20 20 20 20 | 49 66 20 79 6f 75 20 67 |... |If you g|
|00000c30| 75 65 73 73 65 64 20 22 | 75 6e 74 69 6c 20 4c 41 |uessed "|until LA|
|00000c40| 53 54 2e 4e 41 4d 45 24 | 20 69 73 20 73 65 74 20 |ST.NAME$| is set |
|00000c50| 65 71 75 61 6c 20 74 6f | 20 45 4f 46 22 2c 20 79 |equal to| EOF", y|
|00000c60| 6f 75 20 61 72 65 0d 0a | 20 20 20 20 20 61 62 73 |ou are..| abs|
|00000c70| 6f 6c 75 74 65 6c 79 20 | 72 69 67 68 74 2e 20 20 |olutely |right. |
|00000c80| 54 68 65 20 57 48 49 4c | 45 20 6c 69 74 65 72 61 |The WHIL|E litera|
|00000c90| 6c 6c 79 20 6d 65 61 6e | 73 20 77 68 61 74 20 69 |lly mean|s what i|
|00000ca0| 74 20 73 61 79 73 2c 20 | 22 70 65 72 66 6f 72 6d |t says, |"perform|
|00000cb0| 20 74 68 69 73 0d 0a 20 | 20 20 20 20 6c 6f 6f 70 | this.. | loop|
|00000cc0| 20 61 73 20 6c 6f 6e 67 | 20 61 73 20 74 68 65 20 | as long| as the |
|00000cd0| 76 61 6c 75 65 20 45 4f | 46 20 69 73 20 6e 6f 74 |value EO|F is not|
|00000ce0| 20 61 73 73 69 67 6e 65 | 64 20 74 6f 20 4c 41 53 | assigne|d to LAS|
|00000cf0| 54 2e 4e 41 4d 45 24 22 | 2e 20 20 54 68 65 20 6c |T.NAME$"|. The l|
|00000d00| 6f 6f 70 0d 0a 20 20 20 | 20 20 73 74 6f 70 73 20 |oop.. | stops |
|00000d10| 77 68 65 6e 20 4c 41 53 | 54 2e 4e 41 4d 45 24 20 |when LAS|T.NAME$ |
|00000d20| 69 73 20 73 65 74 20 74 | 6f 20 27 45 4f 46 27 2e |is set t|o 'EOF'.|
|00000d30| 20 20 53 74 6f 70 70 69 | 6e 67 2c 20 69 6e 20 74 | Stoppi|ng, in t|
|00000d40| 68 69 73 20 63 6f 6e 74 | 65 78 74 2c 20 6d 65 61 |his cont|ext, mea|
|00000d50| 6e 73 0d 0a 20 20 20 20 | 20 67 6f 20 74 6f 20 74 |ns.. | go to t|
|00000d60| 68 65 20 6c 69 6e 65 20 | 69 6d 6d 65 64 69 61 74 |he line |immediat|
|00000d70| 65 6c 79 20 66 6f 6c 6c | 6f 77 69 6e 67 20 74 68 |ely foll|owing th|
|00000d80| 65 20 57 45 4e 44 20 73 | 74 61 74 65 6d 65 6e 74 |e WEND s|tatement|
|00000d90| 2e 20 20 53 6f 20 77 68 | 65 6e 0d 0a 20 20 20 20 |. So wh|en.. |
|00000da0| 20 4c 41 53 54 2e 4e 41 | 4d 45 24 20 3d 20 27 45 | LAST.NA|ME$ = 'E|
|00000db0| 4f 46 27 2c 20 42 41 53 | 49 43 20 73 6b 69 70 73 |OF', BAS|IC skips|
|00000dc0| 20 74 6f 20 6c 69 6e 65 | 20 31 35 30 2e 0d 0a 0d | to line| 150....|
|00000dd0| 0a 20 20 20 20 20 4f 68 | 20 79 65 73 2c 20 74 68 |. Oh| yes, th|
|00000de0| 65 20 45 4f 46 20 69 73 | 20 61 72 62 69 74 72 61 |e EOF is| arbitra|
|00000df0| 72 79 2e 20 20 4c 69 6e | 65 20 31 39 30 20 63 6f |ry. Lin|e 190 co|
|00000e00| 75 6c 64 20 6a 75 73 74 | 20 61 73 20 77 65 6c 6c |uld just| as well|
|00000e10| 20 68 61 76 65 20 73 61 | 69 64 0d 0a 0d 0a 20 20 | have sa|id.... |
|00000e20| 20 20 20 31 39 30 20 44 | 41 54 41 20 44 55 4d 4d | 190 D|ATA DUMM|
|00000e30| 59 2c 55 4e 43 4c 45 2c | 39 39 39 39 0d 0a 0d 0a |Y,UNCLE,|9999....|
|00000e40| 20 20 20 20 20 77 68 69 | 63 68 20 6d 65 61 6e 73 | whi|ch means|
|00000e50| 20 6c 69 6e 65 20 31 31 | 30 20 77 6f 75 6c 64 20 | line 11|0 would |
|00000e60| 68 61 76 65 20 74 6f 20 | 73 61 79 0d 0a 0d 0a 20 |have to |say.... |
|00000e70| 20 20 20 20 31 32 30 20 | 57 48 49 4c 45 20 4c 41 | 120 |WHILE LA|
|00000e80| 53 54 2e 4e 41 4d 45 24 | 20 3c 3e 20 22 44 55 4d |ST.NAME$| <> "DUM|
|00000e90| 4d 59 22 0d 0a 20 20 20 | 20 20 6f 72 0d 0a 20 20 |MY".. | or.. |
|00000ea0| 20 20 20 31 32 30 20 57 | 48 49 4c 45 20 46 49 52 | 120 W|HILE FIR|
|00000eb0| 53 54 2e 4e 41 4d 45 24 | 20 3c 3e 20 22 55 4e 43 |ST.NAME$| <> "UNC|
|00000ec0| 4c 45 22 0d 0a 20 20 20 | 20 20 6f 72 0d 0a 20 20 |LE".. | or.. |
|00000ed0| 20 20 20 31 32 30 20 57 | 48 49 4c 45 20 20 41 47 | 120 W|HILE AG|
|00000ee0| 45 20 3c 3e 20 39 39 39 | 39 0d 0a 0d 0a 20 20 20 |E <> 999|9.... |
|00000ef0| 20 20 54 68 65 20 76 61 | 72 69 61 62 6c 65 20 74 | The va|riable t|
|00000f00| 68 61 74 20 79 6f 75 20 | 74 65 73 74 20 6f 6e 20 |hat you |test on |
|00000f10| 69 73 20 6e 6f 74 20 69 | 6d 70 6f 72 74 61 6e 74 |is not i|mportant|
|00000f20| 2e 20 20 59 6f 75 20 6d | 75 73 74 2c 20 68 6f 77 |. You m|ust, how|
|00000f30| 65 76 65 72 2c 20 74 65 | 73 74 0d 0a 20 20 20 20 |ever, te|st.. |
|00000f40| 20 6f 6e 20 73 6f 6d 65 | 74 68 69 6e 67 20 6f 6e | on some|thing on|
|00000f50| 20 74 68 65 20 6c 61 73 | 74 20 44 41 54 41 20 6c | the las|t DATA l|
|00000f60| 69 6e 65 2e 20 20 54 68 | 61 74 20 6c 69 6e 65 20 |ine. Th|at line |
|00000f70| 69 73 20 72 65 61 6c 6c | 79 20 61 20 27 64 75 6d |is reall|y a 'dum|
|00000f80| 6d 79 27 20 6c 69 6e 65 | 0d 0a 20 20 20 20 20 74 |my' line|.. t|
|00000f90| 68 61 74 20 74 65 6c 6c | 73 20 79 6f 75 72 20 70 |hat tell|s your p|
|00000fa0| 72 6f 67 72 61 6d 20 74 | 68 61 74 20 74 68 65 72 |rogram t|hat ther|
|00000fb0| 65 20 69 73 20 6e 6f 20 | 6d 6f 72 65 20 69 6e 70 |e is no |more inp|
|00000fc0| 75 74 2e 0d 0a 0d 0a 20 | 20 20 20 20 59 6f 75 20 |ut..... | You |
|00000fd0| 6d 75 73 74 20 75 6e 64 | 65 72 73 74 61 6e 64 20 |must und|erstand |
|00000fe0| 74 77 6f 20 6d 6f 72 65 | 20 74 68 69 6e 67 73 20 |two more| things |
|00000ff0| 62 65 66 6f 72 65 20 77 | 65 20 74 75 72 6e 20 79 |before w|e turn y|
|00001000| 6f 75 20 6c 6f 73 65 20 | 74 6f 20 74 72 79 20 74 |ou lose |to try t|
|00001010| 68 65 0d 0a 20 20 20 20 | 20 61 62 6f 76 65 20 70 |he.. | above p|
|00001020| 72 6f 67 72 61 6d 20 6f | 6e 20 79 6f 75 72 20 50 |rogram o|n your P|
|00001030| 43 2e 20 20 46 69 72 73 | 74 2c 20 6e 6f 74 69 63 |C. Firs|t, notic|
|00001040| 65 20 74 68 61 74 20 74 | 68 65 72 65 20 69 73 20 |e that t|here is |
|00001050| 61 20 52 45 41 44 20 73 | 74 61 74 65 6d 65 6e 74 |a READ s|tatement|
|00001060| 0d 0a 20 20 20 20 20 6f | 6e 20 6c 69 6e 65 20 31 |.. o|n line 1|
|00001070| 30 30 20 61 6e 64 20 74 | 68 61 74 20 74 68 65 20 |00 and t|hat the |
|00001080| 73 74 61 74 65 6d 65 6e | 74 20 69 73 20 6f 75 74 |statemen|t is out|
|00001090| 73 69 64 65 20 74 68 65 | 20 6c 6f 6f 70 2e 20 20 |side the| loop. |
|000010a0| 49 66 20 79 6f 75 20 64 | 6f 6e 27 74 20 64 6f 0d |If you d|on't do.|
|000010b0| 0a 20 20 20 20 20 61 20 | 52 45 41 44 20 66 69 72 |. a |READ fir|
|000010c0| 73 74 2c 20 4c 41 53 54 | 2e 4e 41 4d 45 24 20 77 |st, LAST|.NAME$ w|
|000010d0| 69 6c 6c 20 62 65 20 75 | 6e 64 65 66 69 6e 65 64 |ill be u|ndefined|
|000010e0| 20 77 68 65 6e 20 74 68 | 65 20 57 48 49 4c 45 20 | when th|e WHILE |
|000010f0| 69 6e 73 74 72 75 63 74 | 69 6f 6e 20 69 73 0d 0a |instruct|ion is..|
|00001100| 20 20 20 20 20 65 78 65 | 63 75 74 65 64 2e 0d 0a | exe|cuted...|
|00001110| 0d 0a 20 20 20 20 20 53 | 65 63 6f 6e 64 2c 20 75 |.. S|econd, u|
|00001120| 6e 64 65 72 73 74 61 6e | 64 20 77 68 79 20 77 65 |nderstan|d why we|
|00001130| 20 68 61 76 65 20 61 20 | 52 45 41 44 20 73 74 61 | have a |READ sta|
|00001140| 74 65 6d 65 6e 74 20 6f | 6e 20 6c 69 6e 65 20 31 |tement o|n line 1|
|00001150| 34 30 20 6f 66 20 74 68 | 65 20 6c 6f 6f 70 2e 0d |40 of th|e loop..|
|00001160| 0a 20 20 20 20 20 54 68 | 65 20 63 75 72 72 65 6e |. Th|e curren|
|00001170| 74 20 69 6e 70 75 74 20 | 68 61 73 20 62 65 65 6e |t input |has been|
|00001180| 20 70 72 6f 63 65 73 73 | 65 64 2e 20 20 59 6f 75 | process|ed. You|
|00001190| 20 68 61 76 65 20 74 6f | 20 72 65 61 64 20 69 6e | have to| read in|
|000011a0| 20 74 68 65 20 6e 65 78 | 74 20 73 65 74 0d 0a 20 | the nex|t set.. |
|000011b0| 20 20 20 20 6f 66 20 64 | 61 74 61 20 62 65 66 6f | of d|ata befo|
|000011c0| 72 65 20 79 6f 75 20 67 | 6f 20 62 61 63 6b 20 74 |re you g|o back t|
|000011d0| 6f 20 74 68 65 20 57 48 | 49 4c 45 20 6f 74 68 65 |o the WH|ILE othe|
|000011e0| 72 77 69 73 65 20 4c 41 | 53 54 2e 4e 41 4d 45 24 |rwise LA|ST.NAME$|
|000011f0| 20 77 69 6c 6c 20 6e 65 | 76 65 72 0d 0a 0d 0a 0d | will ne|ver.....|
|00001200| 0a 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |... | |
|00001210| 20 20 20 20 1b 45 20 20 | 20 20 20 20 20 20 20 20 | .E | |
|00001220| 20 20 20 20 20 20 1b 46 | 20 20 20 20 20 1b 45 20 | .F| .E |
|00001230| 20 31 34 0d 0a 0d 0a 0c | 0d 0a 0d 0a 0d 0a 0d 0a | 14.....|........|
|00001240| 1b 46 20 20 20 20 20 1b | 45 43 48 41 50 54 45 52 |.F .|ECHAPTER|
|00001250| 20 32 1b 46 20 20 20 20 | 20 20 20 20 20 20 20 20 | 2.F | |
|00001260| 20 20 20 20 20 1b 45 20 | 55 53 45 46 55 4c 20 50 | .E |USEFUL P|
|00001270| 52 4f 47 52 41 4d 4d 49 | 4e 47 1b 46 20 20 1b 45 |ROGRAMMI|NG.F .E|
|00001280| 20 1b 46 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | .F | |
|00001290| 20 20 1b 45 43 48 41 50 | 54 45 52 20 32 0d 0a 0d | .ECHAP|TER 2...|
|000012a0| 0a 0d 0a 20 20 20 20 20 | 1b 46 63 68 61 6e 67 65 |... |.Fchange|
|000012b0| 2e 20 20 49 66 20 4c 41 | 53 54 2e 4e 41 4d 45 24 |. If LA|ST.NAME$|
|000012c0| 20 64 6f 65 73 20 6e 6f | 74 20 63 68 61 6e 67 65 | does no|t change|
|000012d0| 2c 20 79 6f 75 72 20 70 | 72 6f 67 72 61 6d 20 77 |, your p|rogram w|
|000012e0| 69 6c 6c 20 73 74 61 79 | 20 69 6e 20 74 68 65 0d |ill stay| in the.|
|000012f0| 0a 20 20 20 20 20 6c 6f | 6f 70 20 66 6f 72 65 76 |. lo|op forev|
|00001300| 65 72 20 28 6f 72 20 61 | 74 20 6c 65 61 73 74 20 |er (or a|t least |
|00001310| 75 6e 74 69 6c 20 73 6f | 6d 65 6f 6e 65 20 74 75 |until so|meone tu|
|00001320| 72 6e 73 20 6f 66 66 20 | 74 68 65 20 63 6f 6d 70 |rns off |the comp|
|00001330| 75 74 65 72 20 66 6f 72 | 20 74 68 65 0d 0a 20 20 |uter for| the.. |
|00001340| 20 20 20 6e 69 67 68 74 | 29 2e 0d 0a 0d 0a 20 20 | night|)..... |
|00001350| 20 20 20 4f 6e 20 74 68 | 65 20 72 69 67 68 74 0d | On th|e right.|
|00001360| 0a 20 20 20 20 20 69 73 | 20 61 20 66 6c 6f 77 63 |. is| a flowc|
|00001370| 68 61 72 74 0d 0a 20 20 | 20 20 20 74 68 61 74 20 |hart.. | that |
|00001380| 69 6c 6c 75 73 74 72 61 | 74 65 73 0d 0a 20 20 20 |illustra|tes.. |
|00001390| 20 20 68 6f 77 20 74 68 | 65 20 57 48 49 4c 45 2f | how th|e WHILE/|
|000013a0| 57 45 4e 44 0d 0a 20 20 | 20 20 20 69 73 20 64 69 |WEND.. | is di|
|000013b0| 61 67 72 61 6d 6d 65 64 | 2e 0d 0a 0d 0a 20 20 20 |agrammed|..... |
|000013c0| 20 20 4e 6f 74 65 20 74 | 68 65 20 75 73 65 20 6f | Note t|he use o|
|000013d0| 66 0d 0a 20 20 20 20 20 | 74 68 65 20 64 69 61 6d |f.. |the diam|
|000013e0| 6f 6e 64 2c 20 6f 72 0d | 0a 20 20 20 20 20 64 65 |ond, or.|. de|
|000013f0| 63 69 73 69 6f 6e 20 62 | 6c 6f 63 6b 2e 0d 0a 0d |cision b|lock....|
|00001400| 0a 20 20 20 20 20 41 67 | 61 69 6e 2c 20 6f 75 72 |. Ag|ain, our|
|00001410| 0d 0a 20 20 20 20 20 69 | 6e 69 74 69 61 6c 20 65 |.. i|nitial e|
|00001420| 78 61 6d 70 6c 65 73 0d | 0a 20 20 20 20 20 61 72 |xamples.|. ar|
|00001430| 65 20 70 72 65 74 74 79 | 20 73 69 6d 70 6c 65 0d |e pretty| simple.|
|00001440| 0a 20 20 20 20 20 6e 65 | 76 65 72 74 68 65 6c 65 |. ne|verthele|
|00001450| 73 73 20 69 74 0d 0a 20 | 20 20 20 20 69 73 20 69 |ss it.. | is i|
|00001460| 6d 70 6f 72 74 61 6e 74 | 20 74 6f 0d 0a 20 20 20 |mportant| to.. |
|00001470| 20 20 67 65 74 20 69 6e | 20 74 68 65 20 68 61 62 | get in| the hab|
|00001480| 69 74 0d 0a 20 20 20 20 | 20 6f 66 20 66 6c 6f 77 |it.. | of flow|
|00001490| 63 68 61 72 74 69 6e 67 | 0d 0a 20 20 20 20 20 70 |charting|.. p|
|000014a0| 72 6f 67 72 61 6d 73 20 | 72 69 67 68 74 0d 0a 20 |rograms |right.. |
|000014b0| 20 20 20 20 61 77 61 79 | 2e 20 20 49 74 20 65 78 | away|. It ex|
|000014c0| 70 6c 61 69 6e 73 0d 0a | 20 20 20 20 20 79 6f 75 |plains..| you|
|000014d0| 72 20 70 72 6f 67 72 61 | 6d 20 61 6e 64 0d 0a 20 |r progra|m and.. |
|000014e0| 20 20 20 20 70 72 6f 64 | 75 63 65 73 20 62 65 74 | prod|uces bet|
|000014f0| 74 65 72 20 63 6f 64 65 | 2e 0d 0a 0d 0a 20 20 20 |ter code|..... |
|00001500| 20 20 4a 75 73 74 20 74 | 6f 20 6d 61 6b 65 0d 0a | Just t|o make..|
|00001510| 20 20 20 20 20 73 75 72 | 65 20 79 6f 75 20 64 65 | sur|e you de|
|00001520| 76 65 6c 6f 70 0d 0a 20 | 20 20 20 20 61 6e 64 20 |velop.. | and |
|00001530| 72 65 74 61 69 6e 20 74 | 68 69 73 0d 0a 20 20 20 |retain t|his.. |
|00001540| 20 20 68 61 62 69 74 2c | 20 74 68 65 20 69 6e 73 | habit,| the ins|
|00001550| 74 72 75 63 74 6f 72 0d | 0a 20 20 20 20 20 77 69 |tructor.|. wi|
|00001560| 6c 6c 20 6b 65 65 70 20 | 69 6e 73 69 73 74 69 6e |ll keep |insistin|
|00001570| 67 0d 0a 20 20 20 20 20 | 74 68 61 74 20 79 6f 75 |g.. |that you|
|00001580| 20 73 75 62 6d 69 74 20 | 61 0d 0a 20 20 20 20 20 | submit |a.. |
|00001590| 66 6c 6f 77 63 68 61 72 | 74 20 77 69 74 68 0d 0a |flowchar|t with..|
|000015a0| 20 20 20 20 20 79 6f 75 | 72 20 63 6f 64 65 2e 0d | you|r code..|
|000015b0| 0a 0d 0a 0d 0a 20 20 20 | 20 20 1b 45 45 58 45 52 |..... | .EEXER|
|000015c0| 43 49 53 45 0d 0a 0d 0a | 20 20 20 20 20 1b 46 4f |CISE....| .FO|
|000015d0| 6b 61 79 2c 20 79 6f 75 | 20 6e 6f 77 20 6b 6e 6f |kay, you| now kno|
|000015e0| 77 20 61 6c 6c 20 61 62 | 6f 75 74 20 74 68 65 20 |w all ab|out the |
|000015f0| 57 48 49 4c 45 20 6c 6f | 6f 70 20 61 6e 64 20 61 |WHILE lo|op and a|
|00001600| 72 65 20 70 72 6f 62 61 | 62 6c 79 20 61 20 6c 69 |re proba|bly a li|
|00001610| 74 74 6c 65 0d 0a 20 20 | 20 20 20 74 69 72 65 64 |ttle.. | tired|
|00001620| 20 6f 66 20 72 65 61 64 | 69 6e 67 2e 20 20 57 68 | of read|ing. Wh|
|00001630| 79 20 64 6f 6e 27 74 20 | 79 6f 75 20 73 69 67 6e |y don't |you sign|
|00001640| 20 6f 6e 20 74 6f 20 79 | 6f 75 72 20 50 43 20 61 | on to y|our PC a|
|00001650| 6e 64 20 65 6e 74 65 72 | 20 74 68 65 0d 0a 20 20 |nd enter| the.. |
|00001660| 20 20 20 65 78 61 6d 70 | 6c 65 20 77 65 20 68 61 | examp|le we ha|
|00001670| 76 65 20 62 65 65 6e 20 | 77 6f 72 6b 69 6e 67 20 |ve been |working |
|00001680| 6f 6e 2e 20 20 4f 6e 63 | 65 20 79 6f 75 20 67 65 |on. Onc|e you ge|
|00001690| 74 20 63 6f 6d 66 6f 72 | 74 61 62 6c 65 20 77 69 |t comfor|table wi|
|000016a0| 74 68 20 69 74 2c 20 61 | 64 64 0d 0a 20 20 20 20 |th it, a|dd.. |
|000016b0| 20 73 6f 6d 65 20 44 41 | 54 41 20 73 74 61 74 65 | some DA|TA state|
|000016c0| 6d 65 6e 74 73 20 6f 66 | 20 79 6f 75 72 20 6f 77 |ments of| your ow|
|000016d0| 6e 20 61 6e 64 20 63 68 | 61 6e 67 65 20 73 6f 6d |n and ch|ange som|
|000016e0| 65 20 6f 66 20 74 68 65 | 20 66 69 65 6c 64 73 20 |e of the| fields |
|000016f0| 69 6e 20 74 68 65 0d 0a | 20 20 20 20 20 64 75 6d |in the..| dum|
|00001700| 6d 79 20 44 41 54 41 20 | 73 74 61 74 65 6d 65 6e |my DATA |statemen|
|00001710| 74 20 74 6f 20 74 65 73 | 74 20 6f 6e 20 79 6f 75 |t to tes|t on you|
|00001720| 72 20 6f 77 6e 20 76 61 | 72 69 61 62 6c 65 20 6e |r own va|riable n|
|00001730| 61 6d 65 73 2e 20 20 49 | 6e 20 6f 74 68 65 72 0d |ames. I|n other.|
|00001740| 0a 20 20 20 20 20 77 6f | 72 64 73 2c 20 70 6c 61 |. wo|rds, pla|
|00001750| 79 20 61 20 6c 69 74 74 | 6c 65 20 62 69 74 2e 0d |y a litt|le bit..|
|00001760| 0a 0d 0a 20 20 20 20 20 | 4f 68 20 79 65 73 2c 20 |... |Oh yes, |
|00001770| 61 20 66 69 6e 61 6c 20 | 63 61 75 74 69 6f 6e 2e |a final |caution.|
|00001780| 20 20 52 65 6d 65 6d 62 | 65 72 20 66 72 6f 6d 20 | Rememb|er from |
|00001790| 74 68 65 20 70 72 65 76 | 69 6f 75 73 20 63 68 61 |the prev|ious cha|
|000017a0| 70 74 65 72 20 74 68 61 | 74 20 74 68 65 0d 0a 20 |pter tha|t the.. |
|000017b0| 20 20 20 20 44 41 54 41 | 20 73 74 61 74 65 6d 65 | DATA| stateme|
|000017c0| 6e 74 20 6d 75 73 74 20 | 68 61 76 65 20 61 6e 20 |nt must |have an |
|000017d0| 65 6e 74 72 79 20 66 6f | 72 20 65 76 65 72 79 20 |entry fo|r every |
|000017e0| 76 61 72 69 61 62 6c 65 | 20 69 6e 20 74 68 65 20 |variable| in the |
|000017f0| 52 45 41 44 0d 0a 20 20 | 20 20 20 73 74 61 74 65 |READ.. | state|
|00001800| 6d 65 6e 74 2c 20 73 6f | 20 6d 61 6b 65 20 73 75 |ment, so| make su|
|00001810| 72 65 20 74 68 61 74 20 | 79 6f 75 72 20 6c 61 73 |re that |your las|
|00001820| 74 20 6c 69 6e 65 20 68 | 61 73 20 65 6e 6f 75 67 |t line h|as enoug|
|00001830| 68 20 65 6e 74 72 69 65 | 73 20 6f 6e 20 69 74 20 |h entrie|s on it |
|00001840| 74 6f 0d 0a 20 20 20 20 | 20 6d 61 74 63 68 20 77 |to.. | match w|
|00001850| 68 61 74 20 69 73 20 62 | 65 69 6e 67 20 72 65 61 |hat is b|eing rea|
|00001860| 64 20 69 6e 2e 20 20 4f | 74 68 65 72 77 69 73 65 |d in. O|therwise|
|00001870| 2c 20 79 6f 75 27 6c 6c | 20 67 65 74 20 61 6e 0d |, you'll| get an.|
|00001880| 0a 0d 0a 20 20 20 20 20 | 4f 55 54 20 4f 46 20 44 |... |OUT OF D|
|00001890| 41 54 41 20 49 4e 20 2e | 2e 2e 2e 2e 2e 2e 2e 2e |ATA IN .|........|
|000018a0| 2e 2e 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 20 20 20 20 |........|.... |
|000018b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 1b 45 20 | | .E |
|000018c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 1b | | .|
|000018d0| 46 20 20 20 20 20 1b 45 | 20 20 31 35 0d 0a 0d 0a |F .E| 15....|
|000018e0| 0c 0d 0a 0d 0a 0d 0a 0d | 0a 1b 46 20 20 20 20 20 |........|..F |
|000018f0| 1b 45 43 48 41 50 54 45 | 52 20 32 1b 46 20 20 20 |.ECHAPTE|R 2.F |
|00001900| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 1b 45 | | .E|
|00001910| 20 55 53 45 46 55 4c 20 | 50 52 4f 47 52 41 4d 4d | USEFUL |PROGRAMM|
|00001920| 49 4e 47 1b 46 20 20 1b | 45 20 1b 46 20 20 20 20 |ING.F .|E .F |
|00001930| 20 20 20 20 20 20 20 20 | 20 20 20 1b 45 43 48 41 | | .ECHA|
|00001940| 50 54 45 52 20 32 0d 0a | 0d 0a 0d 0a 20 20 20 20 |PTER 2..|.... |
|00001950| 20 1b 46 74 79 70 65 20 | 6f 66 20 6d 65 73 73 61 | .Ftype |of messa|
|00001960| 67 65 2e 20 20 54 68 65 | 20 64 61 74 61 20 6d 75 |ge. The| data mu|
|00001970| 73 74 20 61 6c 73 6f 20 | 62 65 20 6f 66 20 74 68 |st also |be of th|
|00001980| 65 20 73 61 6d 65 20 74 | 79 70 65 20 61 73 20 74 |e same t|ype as t|
|00001990| 68 65 0d 0a 20 20 20 20 | 20 76 61 72 69 61 62 6c |he.. | variabl|
|000019a0| 65 73 20 69 6e 20 74 68 | 65 20 52 45 41 44 20 73 |es in th|e READ s|
|000019b0| 74 61 74 65 6d 65 6e 74 | 2c 20 65 2e 67 2e 20 61 |tatement|, e.g. a|
|000019c0| 6c 70 68 61 73 20 6f 72 | 20 6e 75 6d 65 72 69 63 |lphas or| numeric|
|000019d0| 73 20 61 73 20 61 70 70 | 72 6f 70 72 69 61 74 65 |s as app|ropriate|
|000019e0| 2e 0d 0a 0d 0a 0d 0a 20 | 20 20 20 20 1b 45 43 4f |....... | .ECO|
|000019f0| 4d 50 41 52 49 53 4f 4e | 53 0d 0a 0d 0a 20 20 20 |MPARISON|S.... |
|00001a00| 20 20 1b 46 53 6f 6d 65 | 74 68 69 6e 67 20 73 6e | .FSome|thing sn|
|00001a10| 75 63 6b 20 75 70 20 6f | 6e 20 75 73 20 69 6e 20 |uck up o|n us in |
|00001a20| 74 68 65 20 6c 61 73 74 | 20 73 65 63 74 69 6f 6e |the last| section|
|00001a30| 2c 20 74 68 65 20 22 3d | 22 20 73 69 67 6e 2e 20 |, the "=|" sign. |
|00001a40| 20 49 74 20 77 61 73 6e | 27 74 0d 0a 20 20 20 20 | It wasn|'t.. |
|00001a50| 20 72 65 61 6c 6c 79 20 | 74 68 65 20 73 69 67 6e | really |the sign|
|00001a60| 20 74 68 61 74 20 73 6e | 75 63 6b 20 75 70 20 62 | that sn|uck up b|
|00001a70| 75 74 20 72 61 74 68 65 | 72 20 74 68 65 20 63 6f |ut rathe|r the co|
|00001a80| 6e 63 65 70 74 20 6f 66 | 20 63 6f 6d 70 61 72 69 |ncept of| compari|
|00001a90| 6e 67 0d 0a 20 20 20 20 | 20 74 68 69 6e 67 73 2e |ng.. | things.|
|00001aa0| 20 20 41 73 20 61 20 66 | 75 6e 63 74 69 6f 6e 20 | As a f|unction |
|00001ab0| 6f 66 20 74 65 73 74 69 | 6e 67 2c 20 6c 6f 67 69 |of testi|ng, logi|
|00001ac0| 63 61 6c 20 70 72 6f 63 | 65 73 73 69 6e 67 20 63 |cal proc|essing c|
|00001ad0| 61 6e 20 65 69 74 68 65 | 72 20 61 73 73 69 67 6e |an eithe|r assign|
|00001ae0| 0d 0a 20 20 20 20 20 61 | 20 76 61 6c 75 65 20 74 |.. a| value t|
|00001af0| 6f 20 61 20 76 61 72 69 | 61 62 6c 65 2c 20 6f 72 |o a vari|able, or|
|00001b00| 20 73 65 6e 64 20 79 6f | 75 72 20 70 72 6f 67 72 | send yo|ur progr|
|00001b10| 61 6d 20 64 6f 77 6e 20 | 61 20 63 65 72 74 61 69 |am down |a certai|
|00001b20| 6e 20 70 61 74 68 0d 0a | 20 20 20 20 20 28 68 6f |n path..| (ho|
|00001b30| 70 65 66 75 6c 6c 79 20 | 6e 6f 74 20 6f 6e 65 20 |pefully |not one |
|00001b40| 69 6e 20 61 20 67 61 72 | 64 65 6e 29 2e 20 20 41 |in a gar|den). A|
|00001b50| 73 20 61 20 72 65 73 75 | 6c 74 2c 20 79 6f 75 72 |s a resu|lt, your|
|00001b60| 20 74 6f 6f 6c 20 6b 69 | 74 20 68 61 73 20 74 6f | tool ki|t has to|
|00001b70| 0d 0a 20 20 20 20 20 69 | 6e 63 6c 75 64 65 20 74 |.. i|nclude t|
|00001b80| 68 65 20 61 62 69 6c 69 | 74 79 20 74 6f 20 74 65 |he abili|ty to te|
|00001b90| 73 74 2e 20 20 4d 6f 73 | 74 20 6f 66 20 74 68 65 |st. Mos|t of the|
|00001ba0| 20 73 79 6d 62 6f 6c 73 | 20 73 68 6f 75 6c 64 20 | symbols| should |
|00001bb0| 6c 6f 6f 6b 20 66 61 6d | 69 6c 69 61 72 3a 0d 0a |look fam|iliar:..|
|00001bc0| 0d 0a 20 20 20 20 20 20 | 20 20 20 3d 20 20 20 20 |.. | = |
|00001bd0| 20 20 20 20 54 68 61 74 | 27 73 20 6f 75 72 20 6f | That|'s our o|
|00001be0| 6c 64 20 66 72 69 65 6e | 64 20 74 68 65 20 65 71 |ld frien|d the eq|
|00001bf0| 75 61 6c 20 73 69 67 6e | 2c 20 65 78 61 6d 70 6c |ual sign|, exampl|
|00001c00| 65 73 20 61 72 65 3a 0d | 0a 20 20 20 20 20 20 20 |es are:.|. |
|00001c10| 20 20 20 20 20 20 20 20 | 20 20 20 41 20 3d 20 42 | | A = B|
|00001c20| 2c 20 4c 41 53 54 2e 4e | 41 4d 45 24 20 3d 20 22 |, LAST.N|AME$ = "|
|00001c30| 4a 4f 4e 45 53 22 2c 20 | 65 74 63 2e 0d 0a 0d 0a |JONES", |etc.....|
|00001c40| 20 20 20 20 20 20 20 20 | 20 3e 20 20 20 20 20 20 | | > |
|00001c50| 20 20 54 68 69 73 20 6f | 6e 65 20 6d 65 61 6e 73 | This o|ne means|
|00001c60| 20 27 67 72 65 61 74 65 | 72 20 74 68 61 6e 27 2c | 'greate|r than',|
|00001c70| 20 65 78 61 6d 70 6c 65 | 73 20 61 72 65 20 41 20 | example|s are A |
|00001c80| 3e 20 42 20 6f 72 0d 0a | 20 20 20 20 20 20 20 20 |> B or..| |
|00001c90| 20 20 20 20 20 20 20 20 | 20 20 46 49 52 53 54 2e | | FIRST.|
|00001ca0| 4e 41 4d 45 24 20 3e 20 | 22 4a 49 4c 4c 22 0d 0a |NAME$ > |"JILL"..|
|00001cb0| 0d 0a 20 20 20 20 20 20 | 20 20 20 3e 3d 20 20 20 |.. | >= |
|00001cc0| 20 20 20 20 54 68 69 73 | 20 63 6f 6d 62 69 6e 65 | This| combine|
|00001cd0| 73 20 74 68 65 20 61 62 | 6f 76 65 20 74 77 6f 20 |s the ab|ove two |
|00001ce0| 61 6e 64 20 61 73 20 79 | 6f 75 20 6d 69 67 68 74 |and as y|ou might|
|00001cf0| 20 68 61 76 65 20 67 75 | 65 73 73 65 64 0d 0a 20 | have gu|essed.. |
|00001d00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001d10| 20 6d 65 61 6e 73 20 27 | 67 72 65 61 74 65 72 20 | means '|greater |
|00001d20| 74 68 61 6e 20 6f 72 20 | 65 71 75 61 6c 20 74 6f |than or |equal to|
|00001d30| 27 2c 20 65 78 61 6d 70 | 6c 65 73 20 61 72 65 20 |', examp|les are |
|00001d40| 41 47 45 20 3e 3d 20 32 | 31 0d 0a 20 20 20 20 20 |AGE >= 2|1.. |
|00001d50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 6f 72 20 | | or |
|00001d60| 53 54 52 45 45 54 24 20 | 3e 3d 20 41 56 45 4e 55 |STREET$ |>= AVENU|
|00001d70| 45 24 0d 0a 0d 0a 20 20 | 20 20 20 20 20 20 20 3c |E$.... | <|
|00001d80| 20 20 20 20 20 20 20 20 | 46 6c 69 70 20 74 68 65 | |Flip the|
|00001d90| 20 61 72 72 6f 77 68 65 | 61 64 20 61 72 6f 75 6e | arrowhe|ad aroun|
|00001da0| 64 20 61 6e 64 20 69 74 | 20 6d 65 61 6e 73 20 27 |d and it| means '|
|00001db0| 6c 65 73 73 20 74 68 61 | 6e 27 2e 20 20 59 6f 75 |less tha|n'. You|
|00001dc0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00001dd0| 20 20 20 20 63 61 6e 20 | 73 75 62 73 74 69 74 75 | can |substitu|
|00001de0| 74 65 20 69 74 20 69 6e | 20 61 6e 79 20 6f 66 20 |te it in| any of |
|00001df0| 74 68 65 20 61 62 6f 76 | 65 20 65 78 61 6d 70 6c |the abov|e exampl|
|00001e00| 65 73 20 69 66 20 79 6f | 75 20 77 61 6e 74 2e 0d |es if yo|u want..|
|00001e10| 0a 0d 0a 20 20 20 20 20 | 20 20 20 20 3c 3d 20 20 |... | <= |
|00001e20| 20 20 20 20 20 54 68 69 | 73 20 69 73 20 74 68 65 | Thi|s is the|
|00001e30| 20 73 79 6d 62 6f 6c 20 | 66 6f 72 20 27 6c 65 73 | symbol |for 'les|
|00001e40| 73 20 74 68 61 6e 20 6f | 72 20 65 71 75 61 6c 27 |s than o|r equal'|
|00001e50| 0d 0a 0d 0a 20 20 20 20 | 20 20 20 20 20 3c 3e 20 |.... | <> |
|00001e60| 20 20 20 20 20 20 54 68 | 69 73 20 73 79 6d 62 6f | Th|is symbo|
|00001e70| 6c 20 6d 65 61 6e 73 20 | 27 6e 6f 74 20 65 71 75 |l means |'not equ|
|00001e80| 61 6c 27 0d 0a 0d 0a 20 | 20 20 20 20 49 66 20 74 |al'.... | If t|
|00001e90| 68 65 20 61 62 6f 76 65 | 20 61 72 65 20 6f 6c 64 |he above| are old|
|00001ea0| 20 66 61 63 65 73 2c 20 | 69 74 27 73 20 62 65 63 | faces, |it's bec|
|00001eb0| 61 75 73 65 20 42 41 53 | 49 43 20 63 6f 6d 70 61 |ause BAS|IC compa|
|00001ec0| 72 69 73 6f 6e 73 20 75 | 73 65 20 74 68 65 20 73 |risons u|se the s|
|00001ed0| 61 6d 65 0d 0a 20 20 20 | 20 20 73 79 6d 62 6f 6c |ame.. | symbol|
|00001ee0| 73 20 61 73 20 68 69 67 | 68 20 73 63 68 6f 6f 6c |s as hig|h school|
|00001ef0| 20 6d 61 74 68 65 6d 61 | 74 69 63 73 2e 0d 0a 0d | mathema|tics....|
|00001f00| 0a 20 20 20 20 20 54 65 | 73 74 69 6e 67 2c 20 6f |. Te|sting, o|
|00001f10| 72 20 63 6f 6d 70 61 72 | 69 73 6f 6e 73 2c 20 6d |r compar|isons, m|
|00001f20| 75 73 74 20 61 6c 77 61 | 79 73 20 62 65 20 6d 61 |ust alwa|ys be ma|
|00001f30| 64 65 20 6f 6e 20 61 6e | 20 41 70 70 6c 65 73 20 |de on an| Apples |
|00001f40| 74 6f 20 41 70 70 6c 65 | 73 0d 0a 20 20 20 20 20 |to Apple|s.. |
|00001f50| 62 61 73 69 73 3b 20 6e | 6f 74 20 41 70 70 6c 65 |basis; n|ot Apple|
|00001f60| 73 20 74 6f 20 49 42 4d | 20 50 43 27 73 2e 20 20 |s to IBM| PC's. |
|00001f70| 54 68 61 74 27 73 20 74 | 68 65 20 63 6f 72 65 20 |That's t|he core |
|00001f80| 6f 66 20 63 6f 6d 70 61 | 72 69 6e 67 2c 20 73 6f |of compa|ring, so|
|00001f90| 20 74 6f 0d 0a 20 20 20 | 20 20 73 70 65 61 6b 2e | to.. | speak.|
|00001fa0| 20 20 45 72 67 6f 2c 20 | 77 68 65 6e 20 79 6f 75 | Ergo, |when you|
|00001fb0| 20 77 72 69 74 65 20 79 | 6f 75 72 20 70 72 6f 67 | write y|our prog|
|00001fc0| 72 61 6d 73 20 61 6c 77 | 61 79 73 20 63 6f 6d 70 |rams alw|ays comp|
|00001fd0| 61 72 65 20 61 6c 70 68 | 61 73 20 74 6f 0d 0a 20 |are alph|as to.. |
|00001fe0| 20 20 20 20 61 6c 70 68 | 61 73 20 61 6e 64 20 6e | alph|as and n|
|00001ff0| 75 6d 65 72 69 63 73 20 | 74 6f 20 6e 75 6d 65 72 |umerics |to numer|
|00002000| 69 63 73 2e 20 20 44 6f | 20 6e 6f 74 20 63 6f 6d |ics. Do| not com|
|00002010| 70 61 72 65 20 61 6c 70 | 68 61 73 20 74 6f 20 6e |pare alp|has to n|
|00002020| 75 6d 65 72 69 63 73 2e | 0d 0a 20 20 20 20 20 54 |umerics.|.. T|
|00002030| 68 65 20 63 6f 6d 70 75 | 74 65 72 2c 20 77 69 74 |he compu|ter, wit|
|00002040| 68 20 69 74 27 73 20 6c | 69 74 65 72 61 6c 20 6d |h it's l|iteral m|
|00002050| 65 6e 74 61 6c 69 74 79 | 2c 20 64 6f 65 73 20 6e |entality|, does n|
|00002060| 6f 74 20 6c 69 6b 65 20 | 74 68 61 74 2e 20 20 41 |ot like |that. A|
|00002070| 6c 73 6f 2c 0d 0a 20 20 | 20 20 20 72 65 6d 65 6d |lso,.. | remem|
|00002080| 62 65 72 20 74 68 61 74 | 20 77 68 65 6e 20 79 6f |ber that| when yo|
|00002090| 75 20 63 6f 6d 70 61 72 | 65 20 73 74 72 69 6e 67 |u compar|e string|
|000020a0| 20 76 61 72 69 61 62 6c | 65 73 20 28 65 2e 67 2e | variabl|es (e.g.|
|000020b0| 20 53 54 52 45 45 54 24 | 3d 41 56 45 4e 55 45 24 | STREET$|=AVENUE$|
|000020c0| 29 0d 0a 20 20 20 20 20 | 79 6f 75 20 61 72 65 20 |).. |you are |
|000020d0| 63 6f 6d 70 61 72 69 6e | 67 20 77 68 61 74 27 73 |comparin|g what's|
|000020e0| 20 69 6e 20 74 68 65 20 | 63 75 62 62 79 20 68 6f | in the |cubby ho|
|000020f0| 6c 65 73 2e 20 20 49 66 | 2c 20 6f 6e 20 74 68 65 |les. If|, on the|
|00002100| 20 6f 74 68 65 72 20 68 | 61 6e 64 2c 20 79 6f 75 | other h|and, you|
|00002110| 0d 0a 20 20 20 20 20 77 | 61 6e 74 20 74 6f 20 63 |.. w|ant to c|
|00002120| 6f 6d 70 61 72 65 20 74 | 68 65 20 73 74 72 69 6e |ompare t|he strin|
|00002130| 67 20 74 6f 20 61 20 76 | 61 6c 75 65 20 28 4c 41 |g to a v|alue (LA|
|00002140| 53 54 2e 4e 41 4d 45 24 | 20 3d 20 22 45 4f 46 22 |ST.NAME$| = "EOF"|
|00002150| 29 20 74 68 61 74 20 76 | 61 6c 75 65 0d 0a 20 20 |) that v|alue.. |
|00002160| 20 20 20 6d 75 73 74 20 | 61 6c 77 61 79 73 20 62 | must |always b|
|00002170| 65 20 65 6e 63 6c 6f 73 | 65 64 20 69 6e 20 71 75 |e enclos|ed in qu|
|00002180| 6f 74 65 73 20 65 6c 73 | 65 20 42 41 53 49 43 20 |otes els|e BASIC |
|00002190| 77 69 6c 6c 20 74 68 69 | 6e 6b 20 74 68 61 74 20 |will thi|nk that |
|000021a0| 69 74 27 73 20 61 0d 0a | 20 20 20 20 20 6e 75 6d |it's a..| num|
|000021b0| 65 72 69 63 20 76 61 72 | 69 61 62 6c 65 20 73 69 |eric var|iable si|
|000021c0| 6e 63 65 20 69 74 20 64 | 6f 65 73 20 6e 6f 74 20 |nce it d|oes not |
|000021d0| 74 65 72 6d 69 6e 61 74 | 65 20 69 6e 20 61 20 24 |terminat|e in a $|
|000021e0| 20 73 69 67 6e 2e 20 20 | 43 6f 6d 70 75 74 65 72 | sign. |Computer|
|000021f0| 73 0d 0a 20 20 20 20 20 | 73 70 65 6e 64 20 6d 61 |s.. |spend ma|
|00002200| 6a 6f 72 20 70 6f 72 74 | 69 6f 6e 73 20 6f 66 20 |jor port|ions of |
|00002210| 74 68 65 69 72 20 61 64 | 75 6c 74 20 6c 69 76 65 |their ad|ult live|
|00002220| 73 20 64 6f 69 6e 67 20 | 63 6f 6d 70 61 72 69 73 |s doing |comparis|
|00002230| 6f 6e 73 2e 20 20 59 6f | 75 20 6e 65 65 64 0d 0a |ons. Yo|u need..|
|00002240| 20 20 20 20 20 74 6f 20 | 6d 61 6b 65 20 73 75 72 | to |make sur|
|00002250| 65 20 79 6f 75 20 74 68 | 61 74 20 74 68 65 73 65 |e you th|at these|
|00002260| 20 63 6f 6d 70 61 72 69 | 73 6f 6e 73 20 61 72 65 | compari|sons are|
|00002270| 20 64 6f 6e 65 20 63 6f | 72 72 65 63 74 6c 79 2e | done co|rrectly.|
|00002280| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|00002290| 0d 0a 0d 0a 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |...... | |
|000022a0| 20 20 20 20 20 20 20 1b | 45 20 20 20 20 20 20 20 | .|E |
|000022b0| 20 20 20 20 20 20 20 20 | 20 1b 46 20 20 20 20 20 | | .F |
|000022c0| 1b 45 20 20 31 36 0d 0a | 0d 0a 0c 0d 0a 0d 0a 0d |.E 16..|........|
|000022d0| 0a 0d 0a 1b 46 20 20 20 | 20 20 1b 45 43 48 41 50 |....F | .ECHAP|
|000022e0| 54 45 52 20 32 1b 46 20 | 20 20 20 20 20 20 20 20 |TER 2.F | |
|000022f0| 20 20 20 20 20 20 20 20 | 1b 45 20 55 53 45 46 55 | |.E USEFU|
|00002300| 4c 20 50 52 4f 47 52 41 | 4d 4d 49 4e 47 1b 46 20 |L PROGRA|MMING.F |
|00002310| 20 1b 45 20 1b 46 20 20 | 20 20 20 20 20 20 20 20 | .E .F | |
|00002320| 20 20 20 20 20 1b 45 43 | 48 41 50 54 45 52 20 32 | .EC|HAPTER 2|
|00002330| 0d 0a 0d 0a 0d 0a 20 20 | 20 20 20 4d 4f 52 45 20 |...... | MORE |
|00002340| 43 41 56 45 41 54 53 0d | 0a 0d 0a 20 20 20 20 20 |CAVEATS.|... |
|00002350| 1b 46 54 68 65 20 57 48 | 49 4c 45 2f 57 45 4e 44 |.FThe WH|ILE/WEND|
|00002360| 20 6c 6f 6f 70 20 69 73 | 20 61 20 74 6f 6f 6c 20 | loop is| a tool |
|00002370| 74 68 61 74 20 77 65 20 | 77 69 6c 6c 20 62 65 20 |that we |will be |
|00002380| 75 73 69 6e 67 20 66 72 | 6f 6d 20 6e 6f 77 20 6f |using fr|om now o|
|00002390| 6e 2e 20 20 59 6f 75 0d | 0a 20 20 20 20 20 6e 65 |n. You.|. ne|
|000023a0| 65 64 20 74 6f 20 61 73 | 73 6f 63 69 61 74 65 20 |ed to as|sociate |
|000023b0| 74 68 65 20 75 73 65 20 | 6f 66 20 74 68 69 73 20 |the use |of this |
|000023c0| 6c 6f 6f 70 20 77 69 74 | 68 20 74 68 65 20 63 6f |loop wit|h the co|
|000023d0| 64 69 6e 67 20 6f 66 20 | 61 20 72 65 70 65 74 69 |ding of |a repeti|
|000023e0| 74 69 76 65 0d 0a 20 20 | 20 20 20 70 72 6f 63 65 |tive.. | proce|
|000023f0| 73 73 2e 20 20 42 79 20 | 74 68 65 20 74 69 6d 65 |ss. By |the time|
|00002400| 20 77 65 20 66 69 6e 69 | 73 68 2c 20 79 6f 75 20 | we fini|sh, you |
|00002410| 77 69 6c 6c 20 62 65 20 | 6e 65 73 74 69 6e 67 20 |will be |nesting |
|00002420| 61 6c 6c 20 6b 69 6e 64 | 73 20 6f 66 20 73 74 75 |all kind|s of stu|
|00002430| 66 66 0d 0a 20 20 20 20 | 20 69 6e 73 69 64 65 20 |ff.. | inside |
|00002440| 69 74 2c 20 69 6e 63 6c | 75 64 69 6e 67 20 6f 74 |it, incl|uding ot|
|00002450| 68 65 72 20 57 48 49 4c | 45 2f 57 45 4e 44 20 6c |her WHIL|E/WEND l|
|00002460| 6f 6f 70 73 2e 20 20 47 | 65 74 20 63 6f 6d 66 6f |oops. G|et comfo|
|00002470| 72 74 61 62 6c 65 20 77 | 69 74 68 20 74 68 69 73 |rtable w|ith this|
|00002480| 0d 0a 20 20 20 20 20 66 | 65 6c 6c 6f 77 2c 20 68 |.. f|ellow, h|
|00002490| 65 27 73 20 61 20 6d 61 | 6a 6f 72 20 77 6f 72 6b |e's a ma|jor work|
|000024a0| 68 6f 72 73 65 2e 0d 0a | 0d 0a 0d 0a 20 20 20 20 |horse...|.... |
|000024b0| 20 1b 45 41 52 49 54 48 | 4d 45 54 49 43 20 4f 50 | .EARITH|METIC OP|
|000024c0| 45 52 41 54 49 4f 4e 53 | 0d 0a 0d 0a 20 20 20 20 |ERATIONS|.... |
|000024d0| 20 1b 46 54 69 6d 65 20 | 74 6f 20 6c 6f 6f 6b 20 | .FTime |to look |
|000024e0| 61 74 20 61 72 69 74 68 | 6d 65 74 69 63 20 6f 70 |at arith|metic op|
|000024f0| 65 72 61 74 69 6f 6e 73 | 2e 20 20 49 6e 20 42 41 |erations|. In BA|
|00002500| 53 49 43 2c 20 74 68 65 | 73 65 20 61 72 65 20 70 |SIC, the|se are p|
|00002510| 72 65 74 74 79 20 63 6c | 6f 73 65 0d 0a 20 20 20 |retty cl|ose.. |
|00002520| 20 20 74 6f 20 74 68 65 | 69 72 20 6d 61 74 68 65 | to the|ir mathe|
|00002530| 6d 61 74 69 63 61 6c 20 | 63 6f 75 73 69 6e 73 3a |matical |cousins:|
|00002540| 0d 0a 0d 0a 20 20 20 20 | 20 20 20 20 20 2b 20 20 |.... | + |
|00002550| 20 20 20 20 54 68 69 73 | 20 69 73 20 79 6f 75 72 | This| is your|
|00002560| 20 73 74 61 6e 64 61 72 | 64 20 72 75 6e 2d 6f 66 | standar|d run-of|
|00002570| 2d 74 68 65 2d 6d 69 6c | 6c 20 70 6c 75 73 20 73 |-the-mil|l plus s|
|00002580| 69 67 6e 20 77 68 69 63 | 68 20 77 6f 72 6b 73 0d |ign whic|h works.|
|00002590| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000025a0| 20 61 73 20 66 6f 6c 6c | 6f 77 73 3a 20 41 20 3d | as foll|ows: A =|
|000025b0| 20 43 20 2b 20 59 20 6d | 65 61 6e 73 20 74 68 61 | C + Y m|eans tha|
|000025c0| 74 20 41 20 69 73 20 74 | 68 65 20 73 75 6d 20 6f |t A is t|he sum o|
|000025d0| 66 20 43 20 61 6e 64 20 | 59 2e 0d 0a 20 20 20 20 |f C and |Y... |
|000025e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 50 72 65 74 | | Pret|
|000025f0| 74 79 20 61 77 65 73 6f | 6d 65 2c 20 69 73 6e 27 |ty aweso|me, isn'|
|00002600| 74 20 69 74 2e 0d 0a 0d | 0a 20 20 20 20 20 20 20 |t it....|. |
|00002610| 20 20 2d 20 20 20 20 20 | 20 54 68 65 20 6d 69 6e | - | The min|
|00002620| 75 73 20 73 69 67 6e 20 | 61 6c 73 6f 20 77 6f 72 |us sign |also wor|
|00002630| 6b 73 20 74 68 65 20 73 | 61 6d 65 20 61 73 20 69 |ks the s|ame as i|
|00002640| 6e 20 6d 61 74 68 65 6d | 61 74 69 63 73 2e 0d 0a |n mathem|atics...|
|00002650| 0d 0a 20 20 20 20 20 20 | 20 20 20 2a 20 20 20 20 |.. | * |
|00002660| 20 20 54 68 65 20 74 69 | 6d 65 73 20 73 69 67 6e | The ti|mes sign|
|00002670| 20 69 73 20 73 6c 69 67 | 68 74 6c 79 20 64 69 66 | is slig|htly dif|
|00002680| 66 65 72 65 6e 74 2e 20 | 20 50 41 59 20 69 73 20 |ferent. | PAY is |
|00002690| 74 68 65 20 70 72 6f 64 | 75 63 74 0d 0a 20 20 20 |the prod|uct.. |
|000026a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 6f 66 20 | | of |
|000026b0| 48 4f 55 52 53 2e 57 4f | 52 4b 45 44 20 74 69 6d |HOURS.WO|RKED tim|
|000026c0| 65 73 20 48 4f 55 52 4c | 59 2e 52 41 54 45 20 69 |es HOURL|Y.RATE i|
|000026d0| 73 20 63 6f 64 65 64 20 | 61 73 20 66 6f 6c 6c 6f |s coded |as follo|
|000026e0| 77 73 3a 0d 0a 0d 0a 20 | 20 20 20 20 20 20 20 20 |ws:.... | |
|000026f0| 20 20 20 20 20 20 20 50 | 41 59 20 3d 20 48 4f 55 | P|AY = HOU|
|00002700| 52 53 2e 57 4f 52 4b 45 | 44 20 2a 20 48 4f 55 52 |RS.WORKE|D * HOUR|
|00002710| 4c 59 2e 52 41 54 45 0d | 0a 0d 0a 20 20 20 20 20 |LY.RATE.|... |
|00002720| 20 20 20 20 2f 20 20 20 | 20 20 20 54 68 69 73 20 | / | This |
|00002730| 69 73 20 74 68 65 20 6f | 6c 64 20 27 67 61 7a 7a |is the o|ld 'gazz|
|00002740| 69 6e 74 6f 27 20 6f 72 | 20 64 69 76 69 73 69 6f |into' or| divisio|
|00002750| 6e 20 73 69 67 6e 2e 20 | 20 46 6f 72 20 74 68 65 |n sign. | For the|
|00002760| 20 61 62 6f 76 65 0d 0a | 20 20 20 20 20 20 20 20 | above..| |
|00002770| 20 20 20 20 20 20 20 20 | 76 61 72 69 61 62 6c 65 | |variable|
|00002780| 73 2c 20 69 66 20 77 65 | 20 6b 6e 65 77 20 50 41 |s, if we| knew PA|
|00002790| 59 20 61 6e 64 20 48 4f | 55 52 53 2e 57 4f 52 4b |Y and HO|URS.WORK|
|000027a0| 45 44 20 77 65 20 63 6f | 75 6c 64 20 66 69 6e 64 |ED we co|uld find|
|000027b0| 20 74 68 65 0d 0a 20 20 | 20 20 20 20 20 20 20 20 | the.. | |
|000027c0| 20 20 20 20 20 20 72 61 | 74 65 20 62 79 20 63 6f | ra|te by co|
|000027d0| 64 69 6e 67 3a 0d 0a 0d | 0a 20 20 20 20 20 20 20 |ding:...|. |
|000027e0| 20 20 20 20 20 20 20 20 | 20 48 4f 55 52 4c 59 2e | | HOURLY.|
|000027f0| 52 41 54 45 20 3d 20 50 | 41 59 20 2f 20 48 4f 55 |RATE = P|AY / HOU|
|00002800| 52 53 2e 57 4f 52 4b 45 | 44 0d 0a 0d 0a 20 20 20 |RS.WORKE|D.... |
|00002810| 20 20 54 68 65 20 6f 72 | 64 65 72 20 6f 66 20 6f | The or|der of o|
|00002820| 70 65 72 61 74 69 6f 6e | 73 20 69 73 20 74 68 65 |peration|s is the|
|00002830| 20 73 61 6d 65 20 61 73 | 20 69 6e 20 6d 61 74 68 | same as| in math|
|00002840| 65 6d 61 74 69 63 73 2e | 20 20 4d 75 6c 74 69 70 |ematics.| Multip|
|00002850| 6c 69 63 61 74 69 6f 6e | 0d 0a 20 20 20 20 20 61 |lication|.. a|
|00002860| 6e 64 20 64 69 76 69 73 | 69 6f 6e 20 61 72 65 20 |nd divis|ion are |
|00002870| 70 65 72 66 6f 72 6d 65 | 64 20 62 65 66 6f 72 65 |performe|d before|
|00002880| 20 61 64 64 69 74 69 6f | 6e 20 61 6e 64 20 73 75 | additio|n and su|
|00002890| 62 74 72 61 63 74 69 6f | 6e 2e 20 20 4f 70 65 72 |btractio|n. Oper|
|000028a0| 61 74 69 6f 6e 73 0d 0a | 20 20 20 20 20 6f 66 20 |ations..| of |
|000028b0| 74 68 65 20 73 61 6d 65 | 20 6d 61 67 6e 69 74 75 |the same| magnitu|
|000028c0| 64 65 20 28 65 2e 67 2e | 20 6d 75 6c 74 69 70 6c |de (e.g.| multipl|
|000028d0| 69 63 61 74 69 6f 6e 20 | 6f 72 20 64 69 76 69 73 |ication |or divis|
|000028e0| 69 6f 6e 29 20 61 72 65 | 20 64 6f 6e 65 20 66 72 |ion) are| done fr|
|000028f0| 6f 6d 0d 0a 20 20 20 20 | 20 72 69 67 68 74 20 74 |om.. | right t|
|00002900| 6f 20 6c 65 66 74 2e 20 | 20 55 73 65 20 70 61 72 |o left. | Use par|
|00002910| 65 6e 74 68 65 73 65 73 | 20 69 66 20 79 6f 75 20 |entheses| if you |
|00002920| 77 61 6e 74 20 74 6f 20 | 62 65 20 73 75 72 65 20 |want to |be sure |
|00002930| 6f 66 20 74 68 65 20 6f | 72 64 65 72 3a 0d 0a 0d |of the o|rder:...|
|00002940| 0a 20 20 20 20 20 31 35 | 30 20 43 45 4e 54 49 47 |. 15|0 CENTIG|
|00002950| 52 41 44 45 20 3d 20 28 | 35 2f 39 29 2a 28 46 41 |RADE = (|5/9)*(FA|
|00002960| 52 45 4e 48 45 49 54 2d | 33 32 29 0d 0a 0d 0a 0d |RENHEIT-|32).....|
|00002970| 0a 20 20 20 20 20 1b 45 | 53 45 4c 46 2d 44 4f 43 |. .E|SELF-DOC|
|00002980| 55 4d 45 4e 54 41 54 49 | 4f 4e 0d 0a 0d 0a 20 20 |UMENTATI|ON.... |
|00002990| 20 20 20 1b 46 53 65 6c | 66 2d 64 6f 63 75 6d 65 | .FSel|f-docume|
|000029a0| 6e 74 61 74 69 6f 6e 20 | 69 73 20 69 6d 70 6c 65 |ntation |is imple|
|000029b0| 6d 65 6e 74 65 64 20 74 | 68 72 6f 75 67 68 20 74 |mented t|hrough t|
|000029c0| 68 65 20 52 45 4d 20 28 | 73 68 6f 72 74 20 66 6f |he REM (|short fo|
|000029d0| 72 20 72 65 6d 61 72 6b | 29 0d 0a 20 20 20 20 20 |r remark|).. |
|000029e0| 73 74 61 74 65 6d 65 6e | 74 2e 20 20 41 73 20 77 |statemen|t. As w|
|000029f0| 65 20 73 74 61 74 65 64 | 20 65 61 72 6c 69 65 72 |e stated| earlier|
|00002a00| 2c 20 69 6e 20 6d 6f 73 | 74 20 6c 61 72 67 65 20 |, in mos|t large |
|00002a10| 62 75 73 69 6e 65 73 73 | 20 65 6e 76 69 72 6f 6e |business| environ|
|00002a20| 6d 65 6e 74 73 0d 0a 20 | 20 20 20 20 61 62 6f 75 |ments.. | abou|
|00002a30| 74 20 38 30 25 20 6f 66 | 20 74 68 65 20 70 72 6f |t 80% of| the pro|
|00002a40| 67 72 61 6d 6d 65 72 73 | 20 73 70 65 6e 64 20 74 |grammers| spend t|
|00002a50| 68 65 69 72 20 74 69 6d | 65 20 65 69 74 68 65 72 |heir tim|e either|
|00002a60| 20 6d 61 69 6e 74 61 69 | 6e 69 6e 67 0d 0a 20 20 | maintai|ning.. |
|00002a70| 20 20 20 65 78 69 73 74 | 69 6e 67 20 70 72 6f 67 | exist|ing prog|
|00002a80| 72 61 6d 73 20 28 6d 61 | 6b 69 6e 67 20 74 68 65 |rams (ma|king the|
|00002a90| 6d 20 64 6f 20 73 6f 6d | 65 74 68 69 6e 67 20 74 |m do som|ething t|
|00002aa0| 68 65 79 20 73 68 6f 75 | 6c 64 20 68 61 76 65 20 |hey shou|ld have |
|00002ab0| 62 65 65 6e 20 61 62 6c | 65 0d 0a 20 20 20 20 20 |been abl|e.. |
|00002ac0| 74 6f 20 64 6f 20 69 6e | 20 74 68 65 20 66 69 72 |to do in| the fir|
|00002ad0| 73 74 20 70 6c 61 63 65 | 29 20 6f 72 20 65 6e 68 |st place|) or enh|
|00002ae0| 61 6e 63 69 6e 67 20 65 | 78 69 73 74 69 6e 67 20 |ancing e|xisting |
|00002af0| 70 72 6f 67 72 61 6d 73 | 20 28 67 65 74 74 69 6e |programs| (gettin|
|00002b00| 67 20 74 68 65 6d 0d 0a | 20 20 20 20 20 74 6f 20 |g them..| to |
|00002b10| 68 61 6e 64 6c 65 20 6e | 65 77 20 66 75 6e 63 74 |handle n|ew funct|
|00002b20| 69 6f 6e 73 2e 29 20 20 | 50 65 6f 70 6c 65 20 73 |ions.) |People s|
|00002b30| 70 65 6e 64 20 61 20 6c | 6f 74 20 6f 66 20 74 69 |pend a l|ot of ti|
|00002b40| 6d 65 20 6c 6f 6f 6b 69 | 6e 67 20 61 74 20 6f 6c |me looki|ng at ol|
|00002b50| 64 0d 0a 20 20 20 20 20 | 63 6f 64 65 2e 20 20 52 |d.. |code. R|
|00002b60| 45 4d 27 73 20 73 68 6f | 75 6c 64 20 74 65 6c 6c |EM's sho|uld tell|
|00002b70| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 61 | the fol|lowing a|
|00002b80| 62 6f 75 74 20 79 6f 75 | 72 20 63 6f 64 65 3a 0d |bout you|r code:.|
|00002b90| 0a 0d 0a 20 20 20 20 20 | 20 20 20 20 2d 20 57 68 |... | - Wh|
|00002ba0| 6f 20 77 72 6f 74 65 20 | 74 68 65 20 70 72 6f 67 |o wrote |the prog|
|00002bb0| 72 61 6d 20 61 6e 64 20 | 77 68 65 6e 0d 0a 20 20 |ram and |when.. |
|00002bc0| 20 20 20 20 20 20 20 2d | 20 41 20 62 72 69 65 66 | -| A brief|
|00002bd0| 20 64 65 73 63 72 69 70 | 74 69 6f 6e 20 6f 66 20 | descrip|tion of |
|00002be0| 77 68 61 74 20 74 68 65 | 20 70 72 6f 67 72 61 6d |what the| program|
|00002bf0| 20 69 73 20 6d 65 61 6e | 74 20 74 6f 20 64 6f 0d | is mean|t to do.|
|00002c00| 0a 20 20 20 20 20 1b 45 | 20 1b 46 20 20 20 2d 20 |. .E| .F - |
|00002c10| 20 41 20 64 65 73 63 72 | 69 70 74 69 6f 6e 20 6f | A descr|iption o|
|00002c20| 66 20 61 6c 6c 20 70 72 | 6f 67 72 61 6d 20 76 61 |f all pr|ogram va|
|00002c30| 72 69 61 62 6c 65 73 20 | 61 6e 64 20 63 6f 6e 73 |riables |and cons|
|00002c40| 74 61 6e 74 73 0d 0a 20 | 20 20 20 20 20 1b 45 20 |tants.. | .E |
|00002c50| 1b 46 20 20 2d 20 20 57 | 68 65 72 65 20 66 75 6e |.F - W|here fun|
|00002c60| 63 74 69 6f 6e 61 6c 20 | 73 65 63 74 69 6f 6e 73 |ctional |sections|
|00002c70| 20 73 74 61 72 74 20 61 | 6e 64 20 73 74 6f 70 0d | start a|nd stop.|
|00002c80| 0a 0d 0a 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |..... | |
|00002c90| 20 20 20 20 20 20 1b 45 | 20 20 20 20 20 20 20 20 | .E| |
|00002ca0| 20 20 20 20 20 20 20 20 | 1b 46 20 20 20 20 20 1b | |.F .|
|00002cb0| 45 20 20 31 37 0d 0a 0d | 0a 0c 0d 0a 0d 0a 0d 0a |E 17...|........|
|00002cc0| 0d 0a 1b 46 20 20 20 20 | 20 1b 45 43 48 41 50 54 |...F | .ECHAPT|
|00002cd0| 45 52 20 32 1b 46 20 20 | 20 20 20 20 20 20 20 20 |ER 2.F | |
|00002ce0| 20 20 20 20 20 20 20 1b | 45 20 55 53 45 46 55 4c | .|E USEFUL|
|00002cf0| 20 50 52 4f 47 52 41 4d | 4d 49 4e 47 1b 46 20 20 | PROGRAM|MING.F |
|00002d00| 1b 45 20 1b 46 20 20 20 | 20 20 20 20 20 20 20 20 |.E .F | |
|00002d10| 20 20 20 20 1b 45 43 48 | 41 50 54 45 52 20 32 0d | .ECH|APTER 2.|
|00002d20| 0a 0d 0a 0d 0a 0d 0a 20 | 20 20 20 20 1b 46 55 6e |....... | .FUn|
|00002d30| 64 65 72 20 6f 6c 64 20 | 42 41 53 49 43 53 2c 20 |der old |BASICS, |
|00002d40| 79 6f 75 72 20 61 63 74 | 75 61 6c 6c 79 20 68 61 |your act|ually ha|
|00002d50| 64 20 74 6f 20 70 75 74 | 20 61 20 52 45 4d 20 72 |d to put| a REM r|
|00002d60| 69 67 68 74 20 61 66 74 | 65 72 20 74 68 65 20 6c |ight aft|er the l|
|00002d70| 69 6e 65 0d 0a 20 20 20 | 20 20 6e 75 6d 62 65 72 |ine.. | number|
|00002d80| 2e 20 20 42 41 53 49 43 | 41 20 6c 65 74 27 73 20 |. BASIC|A let's |
|00002d90| 79 6f 75 20 75 73 65 20 | 61 20 61 70 6f 73 74 72 |you use |a apostr|
|00002da0| 6f 70 68 65 20 28 27 29 | 20 69 6e 73 74 65 61 64 |ophe (')| instead|
|00002db0| 20 6f 66 20 74 68 65 20 | 52 45 4d 2e 20 20 42 79 | of the |REM. By|
|00002dc0| 0d 0a 20 20 20 20 20 74 | 68 65 20 77 61 79 2c 20 |.. t|he way, |
|00002dd0| 74 68 65 20 61 70 6f 73 | 74 72 6f 70 68 65 20 64 |the apos|trophe d|
|00002de0| 6f 65 73 20 6e 6f 74 20 | 68 61 76 65 20 74 6f 20 |oes not |have to |
|00002df0| 62 65 20 61 74 20 74 68 | 65 20 62 65 67 69 6e 6e |be at th|e beginn|
|00002e00| 69 6e 67 20 6f 66 20 74 | 68 65 0d 0a 20 20 20 20 |ing of t|he.. |
|00002e10| 20 6c 69 6e 65 2e 20 20 | 59 6f 75 20 63 61 6e 20 | line. |You can |
|00002e20| 70 75 74 20 69 74 20 61 | 66 74 65 72 20 61 20 6c |put it a|fter a l|
|00002e30| 69 6e 65 20 6f 66 20 6c | 6f 67 69 63 20 74 6f 20 |ine of l|ogic to |
|00002e40| 65 78 70 6c 61 69 6e 20 | 74 68 65 20 63 6f 64 65 |explain |the code|
|00002e50| 3a 0d 0a 0d 0a 20 20 20 | 20 20 31 35 30 20 43 45 |:.... | 150 CE|
|00002e60| 4e 54 49 47 52 41 44 45 | 20 3d 20 28 35 2f 39 29 |NTIGRADE| = (5/9)|
|00002e70| 2a 28 46 41 52 45 4e 48 | 45 49 54 2d 33 32 29 20 |*(FARENH|EIT-32) |
|00002e80| 20 20 20 20 20 20 20 20 | 20 20 20 27 43 6f 6e 76 | | 'Conv|
|00002e90| 65 72 74 20 44 65 67 20 | 46 20 74 6f 20 44 65 67 |ert Deg |F to Deg|
|00002ea0| 20 43 0d 0a 0d 0a 0d 0a | 20 20 20 20 20 1b 45 53 | C......| .ES|
|00002eb0| 55 4d 4d 41 52 59 0d 0a | 0d 0a 20 20 20 20 20 1b |UMMARY..|.. .|
|00002ec0| 46 59 6f 75 20 68 61 76 | 65 20 6c 65 61 72 6e 65 |FYou hav|e learne|
|00002ed0| 64 20 65 6e 6f 75 67 68 | 20 74 6f 20 77 72 69 74 |d enough| to writ|
|00002ee0| 65 20 61 20 75 73 65 66 | 75 6c 20 70 72 6f 67 72 |e a usef|ul progr|
|00002ef0| 61 6d 20 61 6e 64 2c 20 | 61 73 20 69 74 20 74 75 |am and, |as it tu|
|00002f00| 72 6e 73 20 6f 75 74 2c | 0d 0a 20 20 20 20 20 6f |rns out,|.. o|
|00002f10| 75 72 20 66 72 69 65 6e | 64 6c 79 20 73 79 73 74 |ur frien|dly syst|
|00002f20| 65 6d 73 20 61 6e 61 6c | 79 73 74 20 68 61 73 20 |ems anal|yst has |
|00002f30| 61 20 72 65 71 75 65 73 | 74 20 66 6f 72 20 6f 6e |a reques|t for on|
|00002f40| 65 20 66 72 6f 6d 20 68 | 69 73 0d 0a 20 20 20 20 |e from h|is.. |
|00002f50| 20 74 65 6c 65 63 6f 6d | 6d 75 6e 69 63 61 74 69 | telecom|municati|
|00002f60| 6f 6e 73 20 73 65 63 74 | 69 6f 6e 2e 20 20 59 6f |ons sect|ion. Yo|
|00002f70| 75 20 68 61 76 65 20 6a | 75 73 74 20 62 65 65 6e |u have j|ust been|
|00002f80| 20 64 72 61 66 74 65 64 | 20 74 6f 20 77 72 69 74 | drafted| to writ|
|00002f90| 65 20 69 74 2e 0d 0a 0d | 0a 0d 0a 20 20 20 20 20 |e it....|... |
|00002fa0| 1b 45 53 50 45 43 49 46 | 49 43 41 54 49 4f 4e 0d |.ESPECIF|ICATION.|
|00002fb0| 0a 0d 0a 20 20 20 20 20 | 1b 46 41 20 70 72 6f 67 |... |.FA prog|
|00002fc0| 72 61 6d 20 69 73 20 6e | 65 65 64 65 64 20 74 6f |ram is n|eeded to|
|00002fd0| 20 70 72 6f 64 75 63 65 | 20 61 20 74 65 6c 65 70 | produce| a telep|
|00002fe0| 68 6f 6e 65 20 62 69 6c | 6c 69 6e 67 20 66 6f 72 |hone bil|ling for|
|00002ff0| 20 61 6e 79 20 67 69 76 | 65 6e 0d 0a 20 20 20 20 | any giv|en.. |
|00003000| 20 64 65 70 61 72 74 6d | 65 6e 74 2e 20 20 54 68 | departm|ent. Th|
|00003010| 65 20 69 6e 70 75 74 20 | 66 6f 72 20 74 68 65 20 |e input |for the |
|00003020| 70 72 6f 67 72 61 6d 20 | 69 73 3a 0d 0a 0d 0a 20 |program |is:.... |
|00003030| 20 20 20 20 20 20 20 20 | 2d 20 44 65 70 61 72 74 | |- Depart|
|00003040| 6d 65 6e 74 20 4e 61 6d | 65 20 20 20 20 20 20 2d |ment Nam|e -|
|00003050| 20 61 6e 20 61 6c 70 68 | 61 20 76 61 72 69 61 62 | an alph|a variab|
|00003060| 6c 65 0d 0a 20 20 20 20 | 20 20 20 20 20 2d 20 41 |le.. | - A|
|00003070| 63 63 6f 75 6e 74 20 4e | 75 6d 62 65 72 20 20 20 |ccount N|umber |
|00003080| 20 20 20 20 2d 20 61 20 | 6e 75 6d 65 72 69 63 20 | - a |numeric |
|00003090| 76 61 72 69 61 62 6c 65 | 0d 0a 20 20 20 20 20 20 |variable|.. |
|000030a0| 20 20 20 2d 20 4e 75 6d | 62 65 72 20 6f 66 20 74 | - Num|ber of t|
|000030b0| 65 6c 65 70 68 6f 6e 65 | 73 20 2d 20 61 20 6e 75 |elephone|s - a nu|
|000030c0| 6d 65 72 69 63 20 76 61 | 72 69 61 62 6c 65 0d 0a |meric va|riable..|
|000030d0| 0d 0a 20 20 20 20 20 54 | 68 65 20 70 72 6f 67 72 |.. T|he progr|
|000030e0| 61 6d 20 69 73 20 74 6f | 20 70 72 6f 64 75 63 65 |am is to| produce|
|000030f0| 20 61 20 6c 69 73 74 20 | 6f 66 20 64 65 70 61 72 | a list |of depar|
|00003100| 74 6d 65 6e 74 2c 20 61 | 63 63 6f 75 6e 74 20 6e |tment, a|ccount n|
|00003110| 75 6d 62 65 72 2c 20 6e | 75 6d 62 65 72 0d 0a 20 |umber, n|umber.. |
|00003120| 20 20 20 20 6f 66 20 70 | 68 6f 6e 65 73 2c 20 61 | of p|hones, a|
|00003130| 6e 64 20 74 6f 74 61 6c | 20 63 6f 73 74 20 66 6f |nd total| cost fo|
|00003140| 72 20 65 61 63 68 20 64 | 65 70 61 72 74 6d 65 6e |r each d|epartmen|
|00003150| 74 2e 20 20 54 65 73 74 | 20 64 61 74 61 20 69 73 |t. Test| data is|
|00003160| 20 61 73 20 66 6f 6c 6c | 6f 77 73 3a 0d 0a 0d 0a | as foll|ows:....|
|00003170| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 44 65 70 |.. | Dep|
|00003180| 61 72 74 6d 65 6e 74 20 | 20 20 20 20 20 20 20 20 |artment | |
|00003190| 20 20 20 20 20 41 63 63 | 6f 75 6e 74 20 4e 75 6d | Acc|ount Num|
|000031a0| 62 65 72 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |ber | |
|000031b0| 20 20 50 68 6f 6e 65 73 | 0d 0a 0d 0a 20 20 20 20 | Phones|.... |
|000031c0| 20 20 20 20 20 20 20 52 | 65 63 65 69 76 69 6e 67 | R|eceiving|
|000031d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000031e0| 20 20 20 31 32 33 30 30 | 32 20 20 20 20 20 20 20 | 12300|2 |
|000031f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 33 | | 3|
|00003200| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 4d 61 72 |.. | Mar|
|00003210| 6b 65 74 69 6e 67 20 20 | 20 20 20 20 20 20 20 20 |keting | |
|00003220| 20 20 20 20 20 20 20 20 | 20 37 33 34 30 30 31 20 | | 734001 |
|00003230| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003240| 20 20 20 20 20 38 0d 0a | 20 20 20 20 20 20 20 20 | 8..| |
|00003250| 20 20 20 50 65 72 73 6f | 6e 6e 65 6c 20 20 20 20 | Perso|nnel |
|00003260| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 39 | | 9|
|00003270| 39 31 30 32 34 20 20 20 | 20 20 20 20 20 20 20 20 |91024 | |
|00003280| 20 20 20 20 20 20 20 20 | 20 20 20 37 0d 0a 20 20 | | 7.. |
|00003290| 20 20 20 20 20 20 20 20 | 20 43 6f 6d 70 75 74 69 | | Computi|
|000032a0| 6e 67 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |ng | |
|000032b0| 20 20 20 20 20 39 39 39 | 39 39 38 20 20 20 20 20 | 999|998 |
|000032c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000032d0| 20 31 0d 0a 0d 0a 20 20 | 20 20 20 54 68 65 20 63 | 1.... | The c|
|000032e0| 75 72 72 65 6e 74 20 72 | 61 74 65 20 70 65 72 20 |urrent r|ate per |
|000032f0| 70 68 6f 6e 65 20 69 73 | 20 24 31 36 2e 32 35 2f |phone is| $16.25/|
|00003300| 6d 6f 6e 74 68 2e 0d 0a | 0d 0a 20 20 20 20 20 54 |month...|.. T|
|00003310| 68 65 20 70 72 6f 67 72 | 61 6d 20 6f 75 74 70 75 |he progr|am outpu|
|00003320| 74 20 69 73 20 74 6f 20 | 62 65 20 69 6e 20 74 68 |t is to |be in th|
|00003330| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 66 6f 72 6d |e follow|ing form|
|00003340| 61 74 3a 0d 0a 0d 0a 20 | 20 20 20 20 20 20 20 20 |at:.... | |
|00003350| 20 20 20 20 20 20 20 20 | 20 20 20 44 45 50 41 52 | | DEPAR|
|00003360| 54 4d 45 4e 54 20 50 48 | 4f 4e 45 20 42 49 4c 4c |TMENT PH|ONE BILL|
|00003370| 49 4e 47 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ING.. | |
|00003380| 20 20 20 20 20 20 20 20 | 20 3d 3d 3d 3d 3d 3d 3d | | =======|
|00003390| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000033a0| 3d 0d 0a 0d 0a 20 20 20 | 20 20 44 65 70 61 72 74 |=.... | Depart|
|000033b0| 6d 65 6e 74 20 20 20 20 | 20 20 20 41 63 63 6f 75 |ment | Accou|
|000033c0| 6e 74 20 20 20 20 20 20 | 20 50 68 6f 6e 65 73 20 |nt | Phones |
|000033d0| 20 20 20 20 20 20 20 43 | 6f 73 74 0d 0a 20 20 20 | C|ost.. |
|000033e0| 20 20 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 20 20 20 20 | ------|---- |
|000033f0| 20 20 20 2d 2d 2d 2d 2d | 2d 2d 20 20 20 20 20 20 | -----|-- |
|00003400| 20 2d 2d 2d 2d 2d 2d 20 | 20 20 20 20 20 20 20 2d | ------ | -|
|00003410| 2d 2d 2d 0d 0a 0d 0a 20 | 20 20 20 20 52 65 63 65 |---.... | Rece|
|00003420| 69 76 69 6e 67 20 20 20 | 20 20 20 20 20 31 32 33 |iving | 123|
|00003430| 30 32 32 20 20 20 20 20 | 20 20 20 20 20 20 33 20 |022 | 3 |
|00003440| 20 20 20 20 20 20 20 20 | 34 38 2e 37 35 0d 0a 20 | |48.75.. |
|00003450| 20 20 20 20 4d 61 72 6b | 65 74 69 6e 67 20 20 20 | Mark|eting |
|00003460| 20 20 20 20 20 37 33 32 | 30 30 31 20 20 20 20 20 | 732|001 |
|00003470| 20 20 20 20 20 20 38 20 | 20 20 20 20 20 20 20 20 | 8 | |
|00003480| 31 33 32 0d 0a 20 20 20 | 20 20 2e 2e 2e 2e 2e 2e |132.. | ......|
|00003490| 2e 2e 2e 20 20 20 20 20 | 20 20 20 2e 2e 2e 2e 2e |... | .....|
|000034a0| 2e 20 20 20 20 20 20 20 | 20 20 20 20 2e 20 20 20 |. | . |
|000034b0| 20 20 20 20 20 20 2e 2e | 2e 2e 2e 0d 0a 20 20 20 | ..|..... |
|000034c0| 20 20 45 4e 44 20 4f 46 | 20 42 49 4c 4c 49 4e 47 | END OF| BILLING|
|000034d0| 20 52 45 50 4f 52 54 0d | 0a 0d 0a 20 20 20 20 20 | REPORT.|... |
|000034e0| 57 69 74 68 20 6f 75 72 | 20 73 70 65 63 69 66 69 |With our| specifi|
|000034f0| 63 61 74 69 6f 6e 20 69 | 6e 20 68 61 6e 64 2c 20 |cation i|n hand, |
|00003500| 6c 65 74 27 73 20 77 72 | 69 74 65 20 61 20 73 61 |let's wr|ite a sa|
|00003510| 6d 70 6c 65 20 70 72 6f | 67 72 61 6d 20 74 6f 20 |mple pro|gram to |
|00003520| 73 68 6f 77 20 79 6f 75 | 0d 0a 20 20 20 20 20 68 |show you|.. h|
|00003530| 6f 77 20 69 74 20 61 6c | 6c 20 66 69 74 73 20 74 |ow it al|l fits t|
|00003540| 6f 67 65 74 68 65 72 2e | 20 20 4f 75 72 20 70 72 |ogether.| Our pr|
|00003550| 6f 64 75 63 74 20 66 6f | 72 20 74 68 69 73 20 65 |oduct fo|r this e|
|00003560| 78 61 6d 70 6c 65 20 77 | 69 6c 6c 20 62 65 3a 0d |xample w|ill be:.|
|00003570| 0a 0d 0a 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |..... | |
|00003580| 20 20 20 20 20 20 1b 45 | 20 20 20 20 20 20 20 20 | .E| |
|00003590| 20 20 20 20 20 20 20 20 | 1b 46 20 20 20 20 20 1b | |.F .|
|000035a0| 45 20 20 31 38 0d 0a 0d | 0a 0c 0d 0a 0d 0a 0d 0a |E 18...|........|
|000035b0| 0d 0a 1b 46 20 20 20 20 | 20 1b 45 43 48 41 50 54 |...F | .ECHAPT|
|000035c0| 45 52 20 32 1b 46 20 20 | 20 20 20 20 20 20 20 20 |ER 2.F | |
|000035d0| 20 20 20 20 20 20 20 1b | 45 20 55 53 45 46 55 4c | .|E USEFUL|
|000035e0| 20 50 52 4f 47 52 41 4d | 4d 49 4e 47 1b 46 20 20 | PROGRAM|MING.F |
|000035f0| 1b 45 20 1b 46 20 20 20 | 20 20 20 20 20 20 20 20 |.E .F | |
|00003600| 20 20 20 20 1b 45 43 48 | 41 50 54 45 52 20 32 0d | .ECH|APTER 2.|
|00003610| 0a 0d 0a 0d 0a 0d 0a 20 | 20 20 20 20 1b 46 20 20 |....... | .F |
|00003620| 20 20 2d 20 41 20 66 6c | 6f 77 20 63 68 61 72 74 | - A fl|ow chart|
|00003630| 20 74 68 61 74 20 73 68 | 6f 77 73 20 74 68 65 20 | that sh|ows the |
|00003640| 6c 6f 67 69 63 2e 0d 0a | 20 20 20 20 20 20 20 20 |logic...| |
|00003650| 20 2d 20 53 74 72 75 63 | 74 75 72 65 64 20 73 6f | - Struc|tured so|
|00003660| 75 72 63 65 20 63 6f 64 | 65 20 77 69 74 68 20 61 |urce cod|e with a|
|00003670| 70 70 72 6f 70 72 69 61 | 74 65 20 73 65 6c 66 2d |ppropria|te self-|
|00003680| 64 6f 63 75 6d 65 6e 74 | 61 74 69 6f 6e 20 61 6e |document|ation an|
|00003690| 64 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 69 6e |d.. | in|
|000036a0| 64 65 6e 74 61 74 69 6f | 6e 20 66 6f 72 20 61 6c |dentatio|n for al|
|000036b0| 6c 20 6c 6f 6f 70 73 2e | 0d 0a 0d 0a 0d 0a 20 20 |l loops.|...... |
|000036c0| 20 20 20 1b 45 53 41 4d | 50 4c 45 20 46 4c 4f 57 | .ESAM|PLE FLOW|
|000036d0| 43 48 41 52 54 0d 0a 0d | 0a 0d 0a 20 20 20 20 20 |CHART...|... |
|000036e0| 1b 46 54 68 65 20 66 6c | 6f 77 63 68 61 72 74 20 |.FThe fl|owchart |
|000036f0| 6f 6e 20 74 68 65 0d 0a | 20 20 20 20 20 72 69 67 |on the..| rig|
|00003700| 68 74 20 73 68 6f 77 73 | 20 68 6f 77 0d 0a 20 20 |ht shows| how.. |
|00003710| 20 20 20 74 68 65 20 70 | 72 6f 63 65 73 73 69 6e | the p|rocessin|
|00003720| 67 20 77 69 6c 6c 0d 0a | 20 20 20 20 20 66 6c 6f |g will..| flo|
|00003730| 77 2e 20 20 4e 6f 74 65 | 20 74 68 65 0d 0a 20 20 |w. Note| the.. |
|00003740| 20 20 20 66 6f 6c 6c 6f | 77 69 6e 67 3a 0d 0a 0d | follo|wing:...|
|00003750| 0a 20 20 20 20 20 2d 20 | 43 6f 6e 73 74 61 6e 74 |. - |Constant|
|00003760| 73 20 73 75 63 68 0d 0a | 20 20 20 20 20 61 73 20 |s such..| as |
|00003770| 72 61 74 65 20 66 6f 72 | 20 61 20 70 68 6f 6e 65 |rate for| a phone|
|00003780| 0d 0a 20 20 20 20 20 61 | 72 65 20 61 6c 77 61 79 |.. a|re alway|
|00003790| 73 20 64 65 66 69 6e 65 | 64 0d 0a 20 20 20 20 20 |s define|d.. |
|000037a0| 61 74 20 74 68 65 20 62 | 65 67 69 6e 6e 69 6e 67 |at the b|eginning|
|000037b0| 20 6f 66 0d 0a 20 20 20 | 20 20 74 68 65 20 70 72 | of.. | the pr|
|000037c0| 6f 67 72 61 6d 2e 20 20 | 54 68 61 74 20 77 61 79 |ogram. |That way|
|000037d0| 0d 0a 20 20 20 20 20 79 | 6f 75 20 61 6c 77 61 79 |.. y|ou alway|
|000037e0| 73 20 6b 6e 6f 77 20 77 | 68 65 72 65 0d 0a 20 20 |s know w|here.. |
|000037f0| 20 20 20 74 6f 20 66 69 | 6e 64 20 74 68 65 6d 2e | to fi|nd them.|
|00003800| 20 20 4e 65 76 65 72 0d | 0a 20 20 20 20 20 62 75 | Never.|. bu|
|00003810| 69 6c 64 20 63 6f 6e 73 | 74 61 6e 74 73 20 69 6e |ild cons|tants in|
|00003820| 74 6f 0d 0a 20 20 20 20 | 20 79 6f 75 72 20 63 6f |to.. | your co|
|00003830| 64 65 2e 0d 0a 0d 0a 20 | 20 20 20 20 2d 20 57 65 |de..... | - We|
|00003840| 20 68 61 76 65 20 74 77 | 6f 20 69 6e 70 75 74 73 | have tw|o inputs|
|00003850| 3b 0d 0a 20 20 20 20 20 | 6f 6e 65 20 62 65 66 6f |;.. |one befo|
|00003860| 72 65 20 74 68 65 20 64 | 65 63 69 73 69 6f 6e 0d |re the d|ecision.|
|00003870| 0a 20 20 20 20 20 73 79 | 6d 62 6f 6c 20 28 74 68 |. sy|mbol (th|
|00003880| 65 20 73 74 61 72 74 20 | 6f 66 0d 0a 20 20 20 20 |e start |of.. |
|00003890| 20 79 6f 75 72 20 57 48 | 49 4c 45 29 2c 20 61 6e | your WH|ILE), an|
|000038a0| 64 0d 0a 20 20 20 20 20 | 74 68 65 20 6f 74 68 65 |d.. |the othe|
|000038b0| 72 20 69 6e 73 69 64 65 | 20 74 68 65 20 6c 6f 6f |r inside| the loo|
|000038c0| 70 2e 0d 0a 0d 0a 20 20 | 20 20 20 2d 20 54 68 65 |p..... | - The|
|000038d0| 20 70 72 6f 63 65 73 73 | 69 6e 67 0d 0a 20 20 20 | process|ing.. |
|000038e0| 20 20 6c 6f 6f 70 20 68 | 61 73 20 61 20 73 69 6e | loop h|as a sin|
|000038f0| 67 6c 65 0d 0a 20 20 20 | 20 20 65 6e 74 72 79 20 |gle.. | entry |
|00003900| 61 6e 64 20 61 20 73 69 | 6e 67 6c 65 0d 0a 20 20 |and a si|ngle.. |
|00003910| 20 20 20 65 78 69 74 2e | 20 20 54 68 69 73 20 69 | exit.| This i|
|00003920| 73 20 61 6e 0d 0a 20 20 | 20 20 20 69 6d 70 6f 72 |s an.. | impor|
|00003930| 74 61 6e 74 20 63 6f 6e | 63 65 70 74 20 69 6e 0d |tant con|cept in.|
|00003940| 0a 20 20 20 20 20 73 74 | 72 75 63 74 75 72 65 64 |. st|ructured|
|00003950| 20 70 72 6f 67 72 61 6d | 6d 69 6e 67 0d 0a 20 20 | program|ming.. |
|00003960| 20 20 20 61 73 20 69 74 | 20 65 6e 73 75 72 65 73 | as it| ensures|
|00003970| 20 74 68 61 74 0d 0a 20 | 20 20 20 20 79 6f 75 20 | that.. | you |
|00003980| 63 61 6e 20 66 6f 6c 6c | 6f 77 20 74 68 65 0d 0a |can foll|ow the..|
|00003990| 20 20 20 20 20 6c 6f 67 | 69 63 20 65 61 73 69 6c | log|ic easil|
|000039a0| 79 2e 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 20 20 20 20 |y.......|.... |
|000039b0| 20 54 68 65 20 66 6c 6f | 77 63 68 61 72 74 20 69 | The flo|wchart i|
|000039c0| 73 20 64 6f 6e 65 20 73 | 6f 20 77 65 20 63 61 6e |s done s|o we can|
|000039d0| 20 73 74 61 72 74 20 74 | 6f 20 63 6f 64 65 2e 20 | start t|o code. |
|000039e0| 20 54 68 65 20 70 72 6f | 67 72 61 6d 20 69 73 20 | The pro|gram is |
|000039f0| 73 68 6f 77 6e 20 6f 6e | 0d 0a 20 20 20 20 20 74 |shown on|.. t|
|00003a00| 68 65 20 6e 65 78 74 20 | 70 61 67 65 2e 20 20 41 |he next |page. A|
|00003a10| 73 20 79 6f 75 20 65 78 | 61 6d 69 6e 65 20 69 74 |s you ex|amine it|
|00003a20| 2c 20 6e 6f 74 69 63 65 | 20 74 68 65 20 66 6f 6c |, notice| the fol|
|00003a30| 6c 6f 77 69 6e 67 3a 0d | 0a 0d 0a 20 20 20 20 20 |lowing:.|... |
|00003a40| 2d 20 4c 69 62 65 72 61 | 6c 20 75 73 65 20 6f 66 |- Libera|l use of|
|00003a50| 20 52 45 4d 20 73 74 61 | 74 65 6d 65 6e 74 73 20 | REM sta|tements |
|00003a60| 6d 61 6b 65 73 20 74 68 | 65 20 63 6f 64 65 20 65 |makes th|e code e|
|00003a70| 61 73 69 65 72 20 74 6f | 20 72 65 61 64 20 62 79 |asier to| read by|
|00003a80| 0d 0a 20 20 20 20 20 20 | 20 73 65 67 6d 65 6e 74 |.. | segment|
|00003a90| 69 6e 67 20 74 68 65 20 | 6c 6f 67 69 63 20 69 6e |ing the |logic in|
|00003aa0| 74 6f 20 61 6e 64 20 65 | 78 70 6c 61 69 6e 69 6e |to and e|xplainin|
|00003ab0| 67 20 65 61 63 68 20 73 | 65 63 74 69 6f 6e 2e 0d |g each s|ection..|
|00003ac0| 0a 20 20 20 20 20 2d 20 | 54 68 65 20 61 75 74 68 |. - |The auth|
|00003ad0| 6f 72 20 61 6e 64 20 74 | 68 65 20 70 75 72 70 6f |or and t|he purpo|
|00003ae0| 73 65 20 6f 66 20 74 68 | 65 20 70 72 6f 67 72 61 |se of th|e progra|
|00003af0| 6d 20 61 72 65 20 73 68 | 6f 77 6e 20 66 69 72 73 |m are sh|own firs|
|00003b00| 74 2e 0d 0a 20 20 20 20 | 20 2d 20 41 6c 6c 20 76 |t... | - All v|
|00003b10| 61 72 69 61 62 6c 65 73 | 20 61 6e 64 20 63 6f 6e |ariables| and con|
|00003b20| 73 74 61 6e 74 73 20 61 | 72 65 20 64 65 66 69 6e |stants a|re defin|
|00003b30| 65 64 20 75 73 69 6e 67 | 20 52 45 4d 73 2e 0d 0a |ed using| REMs...|
|00003b40| 20 20 20 20 20 2d 20 43 | 6f 6e 73 74 61 6e 74 73 | - C|onstants|
|00003b50| 20 61 72 65 20 61 73 73 | 69 67 6e 65 64 20 76 61 | are ass|igned va|
|00003b60| 6c 75 65 73 20 62 65 66 | 6f 72 65 20 74 68 65 20 |lues bef|ore the |
|00003b70| 6c 6f 67 69 63 20 73 74 | 61 72 74 73 2e 0d 0a 20 |logic st|arts... |
|00003b80| 20 20 20 20 2d 20 56 69 | 73 75 61 6c 6c 79 2c 20 | - Vi|sually, |
|00003b90| 62 65 63 61 75 73 65 20 | 6f 66 20 74 68 65 20 6f |because |of the o|
|00003ba0| 66 66 73 65 74 2c 20 74 | 68 65 20 57 48 49 4c 45 |ffset, t|he WHILE|
|00003bb0| 20 6c 6f 6f 70 60 73 20 | 62 65 67 69 6e 6e 69 6e | loop`s |beginnin|
|00003bc0| 67 20 61 6e 64 0d 0a 0d | 0a 0d 0a 20 20 20 20 20 |g and...|... |
|00003bd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 1b 45 20 20 | | .E |
|00003be0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 1b 46 | | .F|
|00003bf0| 20 20 20 20 20 1b 45 20 | 20 31 39 0d 0a 0d 0a 0c | .E | 19.....|
|00003c00| 0d 0a 0d 0a 0d 0a 0d 0a | 1b 46 20 20 20 20 20 1b |........|.F .|
|00003c10| 45 43 48 41 50 54 45 52 | 20 32 1b 46 20 20 20 20 |ECHAPTER| 2.F |
|00003c20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 1b 45 20 | | .E |
|00003c30| 55 53 45 46 55 4c 20 50 | 52 4f 47 52 41 4d 4d 49 |USEFUL P|ROGRAMMI|
|00003c40| 4e 47 1b 46 20 20 1b 45 | 20 1b 46 20 20 20 20 20 |NG.F .E| .F |
|00003c50| 20 20 20 20 20 20 20 20 | 20 20 1b 45 43 48 41 50 | | .ECHAP|
|00003c60| 54 45 52 20 32 0d 0a 0d | 0a 0d 0a 20 20 20 20 20 |TER 2...|... |
|00003c70| 1b 46 20 20 65 6e 64 20 | 61 72 65 20 76 65 72 79 |.F end |are very|
|00003c80| 20 65 61 73 79 20 74 6f | 20 73 65 65 2e 0d 0a 0d | easy to| see....|
|00003c90| 0a 20 20 20 20 20 44 65 | 66 69 6e 69 6e 67 20 63 |. De|fining c|
|00003ca0| 6f 6e 73 74 61 6e 74 73 | 20 69 6e 20 74 68 65 20 |onstants| in the |
|00003cb0| 62 65 67 69 6e 6e 69 6e | 67 20 6f 66 20 79 6f 75 |beginnin|g of you|
|00003cc0| 72 20 70 72 6f 67 72 61 | 6d 20 69 73 20 61 20 6d |r progra|m is a m|
|00003cd0| 75 73 74 2e 20 20 49 66 | 20 79 6f 75 0d 0a 20 20 |ust. If| you.. |
|00003ce0| 20 20 20 62 75 72 79 20 | 70 68 6f 6e 65 20 72 61 | bury |phone ra|
|00003cf0| 74 65 73 20 69 6e 73 69 | 64 65 20 79 6f 75 72 20 |tes insi|de your |
|00003d00| 63 6f 64 65 20 73 6f 6d | 65 62 6f 64 79 20 77 69 |code som|ebody wi|
|00003d10| 6c 6c 20 68 61 76 65 20 | 74 6f 20 6c 6f 6f 6b 20 |ll have |to look |
|00003d20| 66 6f 72 20 74 68 65 6d | 0d 0a 20 20 20 20 20 77 |for them|.. w|
|00003d30| 68 65 6e 20 74 68 65 20 | 72 61 74 65 73 20 63 68 |hen the |rates ch|
|00003d40| 61 6e 67 65 2e 20 20 54 | 68 65 79 20 70 72 6f 62 |ange. T|hey prob|
|00003d50| 61 62 6c 79 20 77 6f 6e | 27 74 20 66 69 6e 64 20 |ably won|'t find |
|00003d60| 61 6c 6c 20 6f 66 20 74 | 68 65 6d 20 65 69 74 68 |all of t|hem eith|
|00003d70| 65 72 2e 0d 0a 0d 0a 20 | 20 20 20 20 31 30 30 20 |er..... | 100 |
|00003d80| 27 20 20 20 50 52 4f 47 | 52 41 4d 20 4e 41 4d 45 |' PROG|RAM NAME|
|00003d90| 3a 20 50 48 4f 4e 45 42 | 49 4c 0d 0a 20 20 20 20 |: PHONEB|IL.. |
|00003da0| 20 31 31 30 20 27 20 20 | 20 57 52 49 54 54 45 4e | 110 ' | WRITTEN|
|00003db0| 20 42 59 3a 20 20 20 54 | 2e 20 41 55 54 48 4f 52 | BY: T|. AUTHOR|
|00003dc0| 0d 0a 20 20 20 20 20 31 | 32 30 20 27 20 20 20 44 |.. 1|20 ' D|
|00003dd0| 41 54 45 20 20 20 20 20 | 20 3a 20 20 20 31 30 2f |ATE | : 10/|
|00003de0| 31 30 2f 37 39 0d 0a 20 | 20 20 20 20 31 33 30 20 |10/79.. | 130 |
|00003df0| 27 0d 0a 20 20 20 20 20 | 31 34 30 20 27 20 20 20 |'.. |140 ' |
|00003e00| 54 48 49 53 20 50 52 4f | 47 52 41 4d 20 50 52 4f |THIS PRO|GRAM PRO|
|00003e10| 44 55 43 45 53 20 41 20 | 54 45 4c 45 50 48 4f 4e |DUCES A |TELEPHON|
|00003e20| 45 20 42 49 4c 4c 20 42 | 59 20 44 45 50 41 52 54 |E BILL B|Y DEPART|
|00003e30| 4d 45 4e 54 20 43 41 4c | 43 55 4c 41 54 49 4e 47 |MENT CAL|CULATING|
|00003e40| 0d 0a 20 20 20 20 20 31 | 35 30 20 27 20 20 20 54 |.. 1|50 ' T|
|00003e50| 48 45 20 41 43 54 55 41 | 4c 20 43 48 41 52 47 45 |HE ACTUA|L CHARGE|
|00003e60| 20 42 59 20 4d 55 4c 54 | 49 50 4c 59 49 4e 47 20 | BY MULT|IPLYING |
|00003e70| 54 48 45 20 4e 55 4d 42 | 45 52 20 4f 46 20 50 48 |THE NUMB|ER OF PH|
|00003e80| 4f 4e 45 53 20 49 4e 20 | 45 41 43 48 0d 0a 20 20 |ONES IN |EACH.. |
|00003e90| 20 20 20 31 36 30 20 27 | 20 20 20 44 45 50 41 52 | 160 '| DEPAR|
|00003ea0| 54 4d 45 4e 54 20 42 59 | 20 54 48 45 20 43 55 52 |TMENT BY| THE CUR|
|00003eb0| 52 45 4e 54 20 52 41 54 | 45 20 50 45 52 20 50 48 |RENT RAT|E PER PH|
|00003ec0| 4f 4e 45 0d 0a 20 20 20 | 20 20 31 37 30 20 27 0d |ONE.. | 170 '.|
|00003ed0| 0a 20 20 20 20 20 31 38 | 30 20 27 20 20 20 49 4e |. 18|0 ' IN|
|00003ee0| 50 55 54 20 56 41 52 49 | 41 42 4c 45 20 4e 41 4d |PUT VARI|ABLE NAM|
|00003ef0| 45 53 20 41 52 45 3a 0d | 0a 20 20 20 20 20 31 39 |ES ARE:.|. 19|
|00003f00| 30 20 27 0d 0a 20 20 20 | 20 20 32 30 30 20 27 20 |0 '.. | 200 ' |
|00003f10| 20 20 44 45 50 54 24 2e | 2e 2e 2e 2e 2e 2e 2e 2e | DEPT$.|........|
|00003f20| 44 45 50 41 52 54 4d 45 | 4e 54 20 4e 41 4d 45 0d |DEPARTME|NT NAME.|
|00003f30| 0a 20 20 20 20 20 32 31 | 30 20 27 20 20 20 41 43 |. 21|0 ' AC|
|00003f40| 43 54 2e 4e 55 4d 2e 2e | 2e 2e 2e 2e 44 45 50 41 |CT.NUM..|....DEPA|
|00003f50| 52 54 4d 45 4e 54 20 41 | 43 43 4f 55 4e 54 20 4e |RTMENT A|CCOUNT N|
|00003f60| 55 4d 42 45 52 0d 0a 20 | 20 20 20 20 32 32 30 20 |UMBER.. | 220 |
|00003f70| 27 20 20 20 50 48 4f 4e | 45 53 2e 2e 2e 2e 2e 2e |' PHON|ES......|
|00003f80| 2e 2e 54 48 45 20 54 4f | 54 41 4c 20 4e 55 4d 42 |..THE TO|TAL NUMB|
|00003f90| 45 52 20 4f 46 20 54 45 | 4c 45 50 48 4f 4e 45 53 |ER OF TE|LEPHONES|
|00003fa0| 20 49 4e 20 54 48 45 20 | 44 45 50 54 2e 0d 0a 20 | IN THE |DEPT... |
|00003fb0| 20 20 20 20 32 33 30 20 | 27 0d 0a 20 20 20 20 20 | 230 |'.. |
|00003fc0| 32 34 30 20 27 20 20 20 | 4f 54 48 45 52 20 56 41 |240 ' |OTHER VA|
|00003fd0| 52 49 41 42 4c 45 53 20 | 41 4e 44 20 43 4f 4e 53 |RIABLES |AND CONS|
|00003fe0| 54 41 4e 54 53 20 41 52 | 45 3a 0d 0a 20 20 20 20 |TANTS AR|E:.. |
|00003ff0| 20 32 35 30 20 27 0d 0a | 20 20 20 20 20 32 36 30 | 250 '..| 260|
|00004000| 20 27 20 20 20 52 41 54 | 45 2e 2e 2e 2e 2e 2e 2e | ' RAT|E.......|
|00004010| 2e 2e 2e 54 48 45 20 43 | 55 52 52 45 4e 54 20 4d |...THE C|URRENT M|
|00004020| 4f 4e 54 48 4c 59 20 52 | 41 54 45 20 50 45 52 20 |ONTHLY R|ATE PER |
|00004030| 50 48 4f 4e 45 2c 20 41 | 20 43 4f 4e 53 54 41 4e |PHONE, A| CONSTAN|
|00004040| 54 0d 0a 20 20 20 20 20 | 32 37 30 20 27 20 20 20 |T.. |270 ' |
|00004050| 43 48 41 52 47 45 2e 2e | 2e 2e 2e 2e 2e 2e 54 4f |CHARGE..|......TO|
|00004060| 54 41 4c 20 43 48 41 52 | 47 45 20 46 4f 52 20 54 |TAL CHAR|GE FOR T|
|00004070| 48 45 20 44 45 50 41 52 | 54 4d 45 4e 54 2c 20 43 |HE DEPAR|TMENT, C|
|00004080| 41 4c 43 55 4c 41 54 45 | 44 0d 0a 20 20 20 20 20 |ALCULATE|D.. |
|00004090| 32 38 30 20 27 0d 0a 20 | 20 20 20 20 32 39 30 20 |280 '.. | 290 |
|000040a0| 27 20 20 20 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 20 20 |' ****|****** |
|000040b0| 20 20 44 45 46 49 4e 49 | 54 49 4f 4e 20 4f 46 20 | DEFINI|TION OF |
|000040c0| 43 4f 4e 53 54 41 4e 54 | 53 20 20 20 20 2a 2a 2a |CONSTANT|S ***|
|000040d0| 2a 2a 2a 2a 2a 2a 2a 0d | 0a 20 20 20 20 20 33 30 |*******.|. 30|
|000040e0| 30 20 27 0d 0a 20 20 20 | 20 20 33 31 30 20 52 41 |0 '.. | 310 RA|
|000040f0| 54 45 20 3d 20 31 36 2e | 32 35 0d 0a 20 20 20 20 |TE = 16.|25.. |
|00004100| 20 33 32 30 20 27 0d 0a | 20 20 20 20 20 33 33 30 | 320 '..| 330|
|00004110| 20 27 20 20 20 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 20 | ' ***|******* |
|00004120| 20 20 20 50 52 4f 43 45 | 53 53 49 4e 47 20 20 20 | PROCE|SSING |
|00004130| 20 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 0d 0a 20 20 | *******|****.. |
|00004140| 20 20 20 33 34 30 20 27 | 0d 0a 20 20 20 20 20 33 | 340 '|.. 3|
|00004150| 35 30 20 50 52 49 4e 54 | 0d 0a 20 20 20 20 20 33 |50 PRINT|.. 3|
|00004160| 36 30 20 50 52 49 4e 54 | 20 22 20 20 20 20 20 20 |60 PRINT| " |
|00004170| 20 20 20 20 20 20 20 44 | 45 50 41 52 54 4d 45 4e | D|EPARTMEN|
|00004180| 54 20 50 48 4f 4e 45 20 | 42 49 4c 4c 49 4e 47 22 |T PHONE |BILLING"|
|00004190| 0d 0a 20 20 20 20 20 33 | 37 30 20 50 52 49 4e 54 |.. 3|70 PRINT|
|000041a0| 20 22 20 20 20 20 20 20 | 20 20 20 20 20 20 20 3d | " | =|
|000041b0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000041c0| 3d 3d 3d 3d 3d 3d 3d 22 | 0d 0a 20 20 20 20 20 33 |======="|.. 3|
|000041d0| 38 30 20 50 52 49 4e 54 | 0d 0a 20 20 20 20 20 33 |80 PRINT|.. 3|
|000041e0| 39 30 20 50 52 49 4e 54 | 0d 0a 20 20 20 20 20 34 |90 PRINT|.. 4|
|000041f0| 30 30 20 50 52 49 4e 54 | 22 20 44 45 50 41 52 54 |00 PRINT|" DEPART|
|00004200| 4d 45 4e 54 20 20 20 20 | 20 20 41 43 43 4f 55 4e |MENT | ACCOUN|
|00004210| 54 20 20 20 20 20 20 20 | 50 48 4f 4e 45 53 20 20 |T |PHONES |
|00004220| 20 20 20 20 43 48 41 52 | 47 45 22 0d 0a 20 20 20 | CHAR|GE".. |
|00004230| 20 20 34 31 30 20 50 52 | 49 4e 54 22 20 2d 2d 2d | 410 PR|INT" ---|
|00004240| 2d 2d 2d 2d 2d 2d 2d 20 | 20 20 20 20 20 2d 2d 2d |------- | ---|
|00004250| 2d 2d 2d 2d 20 20 20 20 | 20 20 20 2d 2d 2d 2d 2d |---- | -----|
|00004260| 2d 20 20 20 20 20 20 2d | 2d 2d 2d 2d 2d 22 0d 0a |- -|-----"..|
|00004270| 20 20 20 20 20 34 32 30 | 20 50 52 49 4e 54 0d 0a | 420| PRINT..|
|00004280| 20 20 20 20 20 34 33 30 | 20 52 45 41 44 20 44 45 | 430| READ DE|
|00004290| 50 54 24 2c 20 41 43 43 | 54 2e 4e 55 4d 2c 20 50 |PT$, ACC|T.NUM, P|
|000042a0| 48 4f 4e 45 53 0d 0a 20 | 20 20 20 20 34 33 35 20 |HONES.. | 435 |
|000042b0| 27 0d 0a 20 20 20 20 20 | 34 34 30 20 57 48 49 4c |'.. |440 WHIL|
|000042c0| 45 20 44 45 50 54 24 20 | 3c 3e 20 22 45 4f 46 22 |E DEPT$ |<> "EOF"|
|000042d0| 0d 0a 20 20 20 20 20 34 | 35 30 20 20 20 20 43 48 |.. 4|50 CH|
|000042e0| 41 52 47 45 20 3d 20 50 | 48 4f 4e 45 53 20 2a 20 |ARGE = P|HONES * |
|000042f0| 52 41 54 45 0d 0a 20 20 | 20 20 20 34 36 30 20 20 |RATE.. | 460 |
|00004300| 20 20 50 52 49 4e 54 20 | 44 45 50 54 24 3b 22 20 | PRINT |DEPT$;" |
|00004310| 20 20 20 20 20 20 22 3b | 41 43 43 54 2e 4e 55 4d | ";|ACCT.NUM|
|00004320| 3b 22 20 20 20 20 20 20 | 20 20 20 22 3b 50 48 4f |;" | ";PHO|
|00004330| 4e 45 53 3b 22 20 20 20 | 20 20 22 3b 43 48 41 52 |NES;" | ";CHAR|
|00004340| 47 45 0d 0a 20 20 20 20 | 20 34 37 30 20 20 20 20 |GE.. | 470 |
|00004350| 52 45 41 44 20 20 44 45 | 50 54 24 2c 20 41 43 43 |READ DE|PT$, ACC|
|00004360| 54 2e 4e 55 4d 2c 20 50 | 48 4f 4e 45 53 0d 0a 20 |T.NUM, P|HONES.. |
|00004370| 20 20 20 20 34 38 30 20 | 57 45 4e 44 0d 0a 20 20 | 480 |WEND.. |
|00004380| 20 20 20 34 38 35 20 27 | 0d 0a 20 20 20 20 20 34 | 485 '|.. 4|
|00004390| 39 30 20 50 52 49 4e 54 | 0d 0a 20 20 20 20 20 35 |90 PRINT|.. 5|
|000043a0| 30 30 20 50 52 49 4e 54 | 20 22 45 4e 44 20 4f 46 |00 PRINT| "END OF|
|000043b0| 20 54 45 4c 45 50 48 4f | 4e 45 20 52 45 50 4f 52 | TELEPHO|NE REPOR|
|000043c0| 54 22 0d 0a 20 20 20 20 | 20 35 31 30 20 27 0d 0a |T".. | 510 '..|
|000043d0| 20 20 20 20 20 35 32 30 | 20 27 20 20 2a 2a 2a 2a | 520| ' ****|
|000043e0| 2a 2a 2a 2a 2a 2a 2a 2a | 20 20 20 20 49 4e 50 55 |********| INPU|
|000043f0| 54 20 44 41 54 41 20 20 | 20 20 2a 2a 2a 2a 2a 2a |T DATA | ******|
|00004400| 2a 2a 2a 2a 2a 2a 0d 0a | 20 20 20 20 20 35 33 30 |******..| 530|
|00004410| 20 27 0d 0a 20 20 20 20 | 20 35 34 30 20 44 41 54 | '.. | 540 DAT|
|00004420| 41 20 52 45 43 45 49 56 | 49 4e 47 2c 31 32 33 30 |A RECEIV|ING,1230|
|00004430| 30 32 2c 33 0d 0a 0d 0a | 0d 0a 20 20 20 20 20 20 |02,3....|.. |
|00004440| 20 20 20 20 20 20 20 20 | 20 20 20 1b 45 20 20 20 | | .E |
|00004450| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 1b 46 20 | | .F |
|00004460| 20 20 20 20 1b 45 20 20 | 32 30 0d 0a 0d 0a 0c 0d | .E |20......|
|00004470| 0a 0d 0a 0d 0a 0d 0a 1b | 46 20 20 20 20 20 1b 45 |........|F .E|
|00004480| 43 48 41 50 54 45 52 20 | 32 1b 46 20 20 20 20 20 |CHAPTER |2.F |
|00004490| 20 20 20 20 20 20 20 20 | 20 20 20 20 1b 45 20 55 | | .E U|
|000044a0| 53 45 46 55 4c 20 50 52 | 4f 47 52 41 4d 4d 49 4e |SEFUL PR|OGRAMMIN|
|000044b0| 47 1b 46 20 20 1b 45 20 | 1b 46 20 20 20 20 20 20 |G.F .E |.F |
|000044c0| 20 20 20 20 20 20 20 20 | 20 1b 45 43 48 41 50 54 | | .ECHAPT|
|000044d0| 45 52 20 32 0d 0a 0d 0a | 0d 0a 20 20 20 20 20 1b |ER 2....|.. .|
|000044e0| 46 35 35 30 20 44 41 54 | 41 20 4d 41 52 4b 45 54 |F550 DAT|A MARKET|
|000044f0| 49 4e 47 2c 37 33 34 30 | 30 31 2c 38 0d 0a 20 20 |ING,7340|01,8.. |
|00004500| 20 20 20 35 36 30 20 44 | 41 54 41 20 50 45 52 53 | 560 D|ATA PERS|
|00004510| 4f 4e 4e 45 4c 2c 39 39 | 31 30 32 34 2c 37 0d 0a |ONNEL,99|1024,7..|
|00004520| 20 20 20 20 20 35 37 30 | 20 44 41 54 41 20 43 4f | 570| DATA CO|
|00004530| 4d 50 55 54 49 4e 47 2c | 39 39 39 39 39 38 2c 31 |MPUTING,|999998,1|
|00004540| 0d 0a 20 20 20 20 20 35 | 38 30 20 44 41 54 41 20 |.. 5|80 DATA |
|00004550| 45 4f 46 2c 39 39 39 2c | 39 0d 0a 20 20 20 20 20 |EOF,999,|9.. |
|00004560| 35 39 30 20 53 54 4f 50 | 0d 0a 20 20 20 20 20 36 |590 STOP|.. 6|
|00004570| 30 30 20 45 4e 44 0d 0a | 0d 0a 20 20 20 20 20 54 |00 END..|.. T|
|00004580| 68 61 74 27 73 20 74 68 | 65 20 70 72 6f 67 72 61 |hat's th|e progra|
|00004590| 6d 2e 20 20 53 69 67 6e | 20 6f 6e 2c 20 74 79 70 |m. Sign| on, typ|
|000045a0| 65 20 69 74 20 69 6e 2c | 20 61 6e 64 20 72 75 6e |e it in,| and run|
|000045b0| 20 69 74 2e 0d 0a 0d 0a | 20 20 20 20 20 4e 6f 77 | it.....| Now|
|000045c0| 20 74 68 61 74 20 79 6f | 75 20 68 61 76 65 20 73 | that yo|u have s|
|000045d0| 65 65 6e 20 69 74 20 64 | 6f 6e 65 2c 20 69 74 27 |een it d|one, it'|
|000045e0| 73 20 74 69 6d 65 20 74 | 6f 20 74 72 79 20 69 74 |s time t|o try it|
|000045f0| 20 6f 6e 20 79 6f 75 72 | 20 6f 77 6e 2e 20 20 4a | on your| own. J|
|00004600| 75 73 74 0d 0a 20 20 20 | 20 20 69 6e 20 74 69 6d |ust.. | in tim|
|00004610| 65 20 61 73 20 61 20 6d | 61 74 74 65 72 20 6f 66 |e as a m|atter of|
|00004620| 20 66 61 63 74 2e 20 20 | 4f 75 72 20 61 6e 61 6c | fact. |Our anal|
|00004630| 79 73 74 20 68 61 73 20 | 61 6e 6f 74 68 65 72 20 |yst has |another |
|00004640| 68 6f 74 20 70 72 6f 67 | 72 61 6d 20 74 68 61 74 |hot prog|ram that|
|00004650| 0d 0a 20 20 20 20 20 73 | 68 6f 75 6c 64 20 68 61 |.. s|hould ha|
|00004660| 76 65 20 62 65 65 6e 20 | 64 6f 6e 65 20 79 65 73 |ve been |done yes|
|00004670| 74 65 72 64 61 79 2e 0d | 0a 0d 0a 0d 0a 20 20 20 |terday..|..... |
|00004680| 20 20 1b 45 53 50 45 43 | 49 46 49 43 41 54 49 4f | .ESPEC|IFICATIO|
|00004690| 4e 0d 0a 0d 0a 20 20 20 | 20 20 1b 46 49 72 76 69 |N.... | .FIrvi|
|000046a0| 6e 67 27 73 20 69 63 65 | 20 63 72 65 61 6d 20 66 |ng's ice| cream f|
|000046b0| 61 63 74 6f 72 79 20 70 | 72 6f 64 75 63 65 73 20 |actory p|roduces |
|000046c0| 74 68 72 65 65 20 74 68 | 69 6e 67 73 2c 20 73 74 |three th|ings, st|
|000046d0| 72 61 77 62 65 72 72 79 | 20 69 63 65 20 63 72 65 |rawberry| ice cre|
|000046e0| 61 6d 2c 0d 0a 20 20 20 | 20 20 73 74 72 61 77 62 |am,.. | strawb|
|000046f0| 65 72 72 79 20 73 61 75 | 63 65 2c 20 61 6e 64 20 |erry sau|ce, and |
|00004700| 73 74 72 61 77 62 65 72 | 72 79 20 63 6f 6e 74 61 |strawber|ry conta|
|00004710| 69 6e 65 72 73 2e 20 20 | 54 68 65 20 64 69 66 66 |iners. |The diff|
|00004720| 65 72 65 6e 63 65 20 62 | 65 74 77 65 65 6e 20 74 |erence b|etween t|
|00004730| 68 65 0d 0a 20 20 20 20 | 20 74 68 72 65 65 20 70 |he.. | three p|
|00004740| 72 6f 64 75 63 74 73 20 | 69 73 20 74 69 6d 69 6e |roducts |is timin|
|00004750| 67 2e 20 20 49 66 20 69 | 74 20 6d 61 6b 65 73 20 |g. If i|t makes |
|00004760| 69 74 20 69 6e 74 6f 20 | 74 68 65 20 66 72 65 65 |it into |the free|
|00004770| 7a 65 72 20 69 6e 20 74 | 69 6d 65 2c 20 69 74 27 |zer in t|ime, it'|
|00004780| 73 0d 0a 20 20 20 20 20 | 69 63 65 20 63 72 65 61 |s.. |ice crea|
|00004790| 6d 2e 20 20 49 66 20 69 | 74 20 6d 65 6c 74 73 20 |m. If i|t melts |
|000047a0| 62 75 74 20 64 6f 65 73 | 20 6e 6f 74 20 6c 65 61 |but does| not lea|
|000047b0| 6b 20 6f 75 74 20 6f 66 | 20 74 68 65 20 63 6f 6e |k out of| the con|
|000047c0| 74 61 69 6e 65 72 2c 20 | 69 74 27 73 0d 0a 20 20 |tainer, |it's.. |
|000047d0| 20 20 20 73 61 75 63 65 | 2c 20 61 6e 64 20 69 66 | sauce|, and if|
|000047e0| 20 79 6f 75 20 77 61 69 | 74 20 74 6f 6f 20 6c 6f | you wai|t too lo|
|000047f0| 6e 67 2c 20 61 6c 6c 20 | 79 6f 75 20 68 61 76 65 |ng, all |you have|
|00004800| 20 6c 65 66 74 20 69 73 | 20 61 20 73 6f 67 67 79 | left is| a soggy|
|00004810| 20 63 6f 6e 74 61 69 6e | 65 72 2e 0d 0a 20 20 20 | contain|er... |
|00004820| 20 20 54 68 65 79 20 6e | 65 65 64 20 61 20 62 69 | They n|eed a bi|
|00004830| 6c 6c 69 6e 67 20 70 72 | 6f 67 72 61 6d 20 66 6f |lling pr|ogram fo|
|00004840| 72 20 74 68 65 69 72 20 | 6e 65 77 20 52 61 73 70 |r their |new Rasp|
|00004850| 62 65 72 72 79 20 58 49 | 49 20 6d 61 69 6e 66 72 |berry XI|I mainfr|
|00004860| 61 6d 65 2e 20 20 54 68 | 65 0d 0a 20 20 20 20 20 |ame. Th|e.. |
|00004870| 69 6e 70 75 74 20 69 73 | 20 61 73 20 66 6f 6c 6c |input is| as foll|
|00004880| 6f 77 73 3a 0d 0a 0d 0a | 20 20 20 20 20 20 20 20 |ows:....| |
|00004890| 20 2d 20 50 72 6f 64 75 | 63 74 20 54 79 70 65 20 | - Produ|ct Type |
|000048a0| 20 20 20 20 20 2d 20 61 | 6e 20 61 6c 70 68 61 20 | - a|n alpha |
|000048b0| 76 61 72 69 61 62 6c 65 | 0d 0a 20 20 20 20 20 20 |variable|.. |
|000048c0| 20 20 20 2d 20 55 6e 69 | 74 20 43 6f 73 74 20 20 | - Uni|t Cost |
|000048d0| 20 20 20 20 20 20 20 2d | 20 61 20 6e 75 6d 65 72 | -| a numer|
|000048e0| 69 63 20 76 61 72 69 61 | 62 6c 65 0d 0a 20 20 20 |ic varia|ble.. |
|000048f0| 20 20 20 20 20 20 2d 20 | 4e 75 6d 62 65 72 20 6f | - |Number o|
|00004900| 66 20 55 6e 69 74 73 20 | 20 20 2d 20 61 20 6e 75 |f Units | - a nu|
|00004910| 6d 65 72 69 63 20 76 61 | 72 69 61 62 6c 65 0d 0a |meric va|riable..|
|00004920| 0d 0a 20 20 20 20 20 54 | 68 65 20 70 72 6f 67 72 |.. T|he progr|
|00004930| 61 6d 20 6d 75 73 74 20 | 70 72 6f 64 75 63 65 20 |am must |produce |
|00004940| 61 20 6c 69 73 74 20 62 | 79 20 70 72 6f 64 75 63 |a list b|y produc|
|00004950| 74 20 73 68 6f 77 69 6e | 67 20 74 79 70 65 2c 20 |t showin|g type, |
|00004960| 75 6e 69 74 20 63 6f 73 | 74 2c 0d 0a 20 20 20 20 |unit cos|t,.. |
|00004970| 20 6e 75 6d 62 65 72 20 | 6f 66 20 75 6e 69 74 73 | number |of units|
|00004980| 2c 20 61 6e 64 20 74 6f | 74 61 6c 20 63 6f 73 74 |, and to|tal cost|
|00004990| 20 66 6f 72 20 74 68 65 | 20 70 72 6f 64 75 63 74 | for the| product|
|000049a0| 2e 20 20 54 68 65 20 6f | 75 74 70 75 74 20 66 6f |. The o|utput fo|
|000049b0| 72 6d 61 74 20 69 73 0d | 0a 20 20 20 20 20 61 73 |rmat is.|. as|
|000049c0| 20 66 6f 6c 6c 6f 77 73 | 3a 0d 0a 0d 0a 20 20 20 | follows|:.... |
|000049d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000049e0| 20 20 20 20 20 20 20 20 | 20 20 49 52 56 27 53 20 | | IRV'S |
|000049f0| 49 4e 56 45 4e 54 4f 52 | 59 0d 0a 20 20 20 20 20 |INVENTOR|Y.. |
|00004a00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004a10| 20 20 20 20 20 20 20 20 | 3d 3d 3d 3d 3d 3d 3d 3d | |========|
|00004a20| 3d 3d 3d 3d 3d 3d 3d 0d | 0a 0d 0a 20 20 20 20 20 |=======.|... |
|00004a30| 50 52 4f 44 55 43 54 20 | 20 20 20 20 20 20 20 20 |PRODUCT | |
|00004a40| 20 55 4e 49 54 20 20 20 | 20 20 20 20 20 20 20 20 | UNIT | |
|00004a50| 20 20 20 20 20 20 20 20 | 20 4e 55 4d 42 45 52 20 | | NUMBER |
|00004a60| 20 20 20 20 20 20 20 20 | 20 20 54 4f 54 41 4c 0d | | TOTAL.|
|00004a70| 0a 20 20 20 20 20 54 59 | 50 45 20 20 20 20 20 20 |. TY|PE |
|00004a80| 20 20 20 20 20 20 20 43 | 4f 53 54 20 20 20 20 20 | C|OST |
|00004a90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 4f | | O|
|00004aa0| 46 20 55 4e 49 54 53 20 | 20 20 20 20 20 20 20 20 |F UNITS | |
|00004ab0| 43 4f 53 54 0d 0a 20 20 | 20 20 20 2d 2d 2d 2d 2d |COST.. | -----|
|00004ac0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2d 2d 2d 2d | | ----|
|00004ad0| 2d 2d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |-- | |
|00004ae0| 20 20 20 20 2d 2d 2d 2d | 2d 2d 20 20 20 20 20 20 | ----|-- |
|00004af0| 20 20 20 20 20 2d 2d 2d | 2d 2d 2d 0d 0a 0d 0a 20 | ---|---.... |
|00004b00| 20 20 20 20 49 43 45 20 | 43 52 45 41 4d 20 20 20 | ICE |CREAM |
|00004b10| 20 20 20 20 20 2e 2e 2e | 2e 2e 20 20 20 20 20 20 | ...|.. |
|00004b20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2e 2e 2e | | ...|
|00004b30| 2e 2e 2e 20 20 20 20 20 | 20 20 20 20 20 20 2e 2e |... | ..|
|00004b40| 2e 2e 2e 0d 0a 20 20 20 | 20 20 53 41 55 43 45 20 |..... | SAUCE |
|00004b50| 20 20 20 20 20 20 20 20 | 20 20 20 2e 2e 2e 2e 2e | | .....|
|00004b60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004b70| 20 20 20 2e 2e 2e 2e 2e | 2e 20 20 20 20 20 20 20 | .....|. |
|00004b80| 20 20 20 20 2e 2e 2e 2e | 2e 0d 0a 20 20 20 20 20 | ....|... |
|00004b90| 43 4f 4e 54 41 49 4e 45 | 52 53 20 20 20 20 20 20 |CONTAINE|RS |
|00004ba0| 20 2e 2e 2e 2e 2e 0d 0a | 20 20 20 20 20 53 61 6d | .......| Sam|
|00004bb0| 70 6c 65 20 64 61 74 61 | 20 69 73 20 67 69 76 65 |ple data| is give|
|00004bc0| 6e 20 62 65 6c 6f 77 3a | 0d 0a 0d 0a 20 20 20 20 |n below:|.... |
|00004bd0| 20 54 59 50 45 20 20 20 | 20 20 20 20 20 20 43 4f | TYPE | CO|
|00004be0| 53 54 20 20 20 20 20 20 | 20 20 20 20 20 20 4e 55 |ST | NU|
|00004bf0| 4d 42 45 52 0d 0a 0d 0a | 20 20 20 20 20 49 43 45 |MBER....| ICE|
|00004c00| 20 43 52 45 41 4d 20 20 | 20 20 34 2e 35 30 20 20 | CREAM | 4.50 |
|00004c10| 20 20 20 20 20 20 20 20 | 20 20 20 20 34 30 0d 0a | | 40..|
|00004c20| 20 20 20 20 20 53 41 55 | 43 45 20 20 20 20 20 20 | SAU|CE |
|00004c30| 20 20 33 2e 30 30 20 20 | 20 20 20 20 20 20 20 20 | 3.00 | |
|00004c40| 20 20 20 20 32 35 0d 0a | 20 20 20 20 20 43 4f 4e | 25..| CON|
|00004c50| 54 41 49 4e 45 52 20 20 | 20 20 31 2e 30 30 20 20 |TAINER | 1.00 |
|00004c60| 20 20 20 20 20 20 20 20 | 20 20 20 31 35 30 0d 0a | | 150..|
|00004c70| 0d 0a 20 20 20 20 20 4d | 61 6b 65 20 73 75 72 65 |.. M|ake sure|
|00004c80| 20 79 6f 75 20 68 61 76 | 65 20 61 20 66 6c 6f 77 | you hav|e a flow|
|00004c90| 63 68 61 72 74 20 66 6f | 72 20 74 68 65 20 61 62 |chart fo|r the ab|
|00004ca0| 6f 76 65 20 61 6e 64 20 | 74 68 61 74 20 61 6c 6c |ove and |that all|
|00004cb0| 20 63 6f 64 65 20 69 73 | 20 69 6e 0d 0a 20 20 20 | code is| in.. |
|00004cc0| 20 20 73 74 72 75 63 74 | 75 72 65 64 20 42 41 53 | struct|ured BAS|
|00004cd0| 49 43 2e 0d 0a 0d 0a 0d | 0a 0d 0a 20 20 20 20 20 |IC......|... |
|00004ce0| 20 20 20 20 20 20 20 20 | 20 20 20 20 1b 45 20 20 | | .E |
|00004cf0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 1b 46 | | .F|
|00004d00| 20 20 20 20 20 1b 45 20 | 20 32 31 0d 0a 0d 0a 0c | .E | 21.....|
|00004d10| 0d 0a 0d 0a 0d 0a 0d 0a | 1b 46 20 20 20 20 20 1b |........|.F .|
|00004d20| 45 43 48 41 50 54 45 52 | 20 32 1b 46 20 20 20 20 |ECHAPTER| 2.F |
|00004d30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 1b 45 20 | | .E |
|00004d40| 55 53 45 46 55 4c 20 50 | 52 4f 47 52 41 4d 4d 49 |USEFUL P|ROGRAMMI|
|00004d50| 4e 47 1b 46 20 20 1b 45 | 20 1b 46 20 20 20 20 20 |NG.F .E| .F |
|00004d60| 20 20 20 20 20 20 20 20 | 20 20 1b 45 43 48 41 50 | | .ECHAP|
|00004d70| 54 45 52 20 32 0d 0a 0d | 0a 0d 0a 20 20 20 20 20 |TER 2...|... |
|00004d80| 1b 46 54 68 6f 75 67 68 | 74 20 79 6f 75 20 77 65 |.FThough|t you we|
|00004d90| 72 65 20 66 69 6e 69 73 | 68 65 64 3f 20 20 41 6c |re finis|hed? Al|
|00004da0| 61 73 2c 20 61 20 70 72 | 6f 67 72 61 6d 6d 65 72 |as, a pr|ogrammer|
|00004db0| 27 73 20 77 6f 72 6b 20 | 69 73 20 6e 65 76 65 72 |'s work |is never|
|00004dc0| 20 64 6f 6e 65 2e 0d 0a | 20 20 20 20 20 54 68 65 | done...| The|
|00004dd0| 72 65 20 69 73 20 6f 6e | 65 20 6d 6f 72 65 20 74 |re is on|e more t|
|00004de0| 61 73 6b 20 62 65 66 6f | 72 65 20 79 6f 75 20 63 |ask befo|re you c|
|00004df0| 61 6e 20 71 75 69 74 20 | 66 6f 72 20 74 68 65 20 |an quit |for the |
|00004e00| 63 68 61 70 74 65 72 2e | 20 20 48 65 61 64 20 74 |chapter.| Head t|
|00004e10| 68 65 6d 0d 0a 20 20 20 | 20 20 75 70 20 61 6e 64 |hem.. | up and|
|00004e20| 20 6d 6f 76 65 20 74 68 | 65 6d 20 6f 75 74 2e 0d | move th|em out..|
|00004e30| 0a 0d 0a 0d 0a 20 20 20 | 20 20 1b 45 53 50 45 43 |..... | .ESPEC|
|00004e40| 49 46 49 43 41 54 49 4f | 4e 0d 0a 0d 0a 20 20 20 |IFICATIO|N.... |
|00004e50| 20 20 1b 46 54 68 65 20 | 45 6d 70 79 72 69 63 61 | .FThe |Empyrica|
|00004e60| 6c 20 45 6d 70 6c 6f 79 | 6d 65 6e 74 20 45 6d 70 |l Employ|ment Emp|
|00004e70| 6f 72 69 75 6d 20 73 70 | 65 63 69 61 6c 69 7a 65 |orium sp|ecialize|
|00004e80| 73 20 69 6e 20 6f 64 64 | 20 6a 6f 62 73 20 66 6f |s in odd| jobs fo|
|00004e90| 72 20 6d 79 74 68 69 63 | 61 6c 0d 0a 20 20 20 20 |r mythic|al.. |
|00004ea0| 20 64 65 69 74 69 65 73 | 2c 20 64 65 6d 69 67 6f | deities|, demigo|
|00004eb0| 64 73 20 61 6e 64 20 6f | 74 68 65 72 20 66 61 62 |ds and o|ther fab|
|00004ec0| 6c 65 64 20 63 72 65 61 | 74 75 72 65 73 2e 20 20 |led crea|tures. |
|00004ed0| 46 6f 72 20 61 20 73 6c | 69 67 68 74 20 66 65 65 |For a sl|ight fee|
|00004ee0| 2c 20 4e 65 70 74 75 6e | 65 0d 0a 20 20 20 20 20 |, Neptun|e.. |
|00004ef0| 6d 61 6b 65 73 20 77 61 | 76 65 73 20 61 74 20 70 |makes wa|ves at p|
|00004f00| 6f 6f 6c 20 70 61 72 74 | 69 65 73 3b 20 41 74 6c |ool part|ies; Atl|
|00004f10| 61 73 20 73 68 6f 75 6c | 64 65 72 73 20 6d 69 72 |as shoul|ders mir|
|00004f20| 72 6f 72 20 62 61 6c 6c | 73 20 61 74 20 44 69 73 |ror ball|s at Dis|
|00004f30| 63 6f 73 3b 0d 0a 20 20 | 20 20 20 73 61 74 79 72 |cos;.. | satyr|
|00004f40| 73 20 67 65 74 20 73 6f | 6d 65 6f 6e 65 27 73 20 |s get so|meone's |
|00004f50| 67 6f 61 74 2c 20 61 6e | 64 20 46 72 65 64 20 28 |goat, an|d Fred (|
|00004f60| 61 6e 63 69 65 6e 74 20 | 67 6f 64 20 6f 66 20 63 |ancient |god of c|
|00004f70| 6f 6d 70 75 74 65 72 73 | 20 61 6e 64 0d 0a 20 20 |omputers| and.. |
|00004f80| 20 20 20 69 6e 73 65 63 | 74 73 29 20 68 65 6c 70 | insec|ts) help|
|00004f90| 73 20 74 6f 20 64 65 62 | 75 67 20 70 72 6f 67 72 |s to deb|ug progr|
|00004fa0| 61 6d 73 2e 20 20 42 65 | 69 6e 67 20 70 72 6f 67 |ams. Be|ing prog|
|00004fb0| 72 65 73 73 69 76 65 2c | 20 74 68 65 79 20 68 61 |ressive,| they ha|
|00004fc0| 76 65 20 61 73 6b 65 64 | 0d 0a 20 20 20 20 20 79 |ve asked|.. y|
|00004fd0| 6f 75 20 74 6f 20 63 6f | 6d 70 75 74 65 72 69 7a |ou to co|mputeriz|
|00004fe0| 65 20 74 68 65 69 72 20 | 70 61 79 72 6f 6c 6c 20 |e their |payroll |
|00004ff0| 6f 6e 20 74 68 65 69 72 | 20 62 72 61 6e 64 20 6e |on their| brand n|
|00005000| 65 77 20 4d 54 20 4f 6c | 79 6d 70 75 73 20 4d 61 |ew MT Ol|ympus Ma|
|00005010| 72 6b 20 56 49 49 0d 0a | 20 20 20 20 20 6d 61 69 |rk VII..| mai|
|00005020| 6e 66 72 61 6d 65 2e 20 | 20 54 68 65 20 69 6e 70 |nframe. | The inp|
|00005030| 75 74 20 69 73 20 61 73 | 20 66 6f 6c 6c 6f 77 73 |ut is as| follows|
|00005040| 3a 0d 0a 0d 0a 20 20 20 | 20 20 20 20 20 20 2d 20 |:.... | - |
|00005050| 44 65 69 74 79 20 4e 61 | 6d 65 20 20 20 20 20 20 |Deity Na|me |
|00005060| 20 20 2d 20 61 6e 20 61 | 6c 70 68 61 20 76 61 72 | - an a|lpha var|
|00005070| 69 61 62 6c 65 0d 0a 20 | 20 20 20 20 20 20 20 20 |iable.. | |
|00005080| 2d 20 48 6f 75 72 6c 79 | 20 52 61 74 65 20 20 20 |- Hourly| Rate |
|00005090| 20 20 20 20 2d 20 61 20 | 6e 75 6d 65 72 69 63 20 | - a |numeric |
|000050a0| 76 61 72 69 61 62 6c 65 | 0d 0a 20 20 20 20 20 20 |variable|.. |
|000050b0| 20 20 20 2d 20 48 6f 75 | 72 73 20 57 6f 72 6b 65 | - Hou|rs Worke|
|000050c0| 64 20 20 20 20 20 20 2d | 20 61 20 6e 75 6d 65 72 |d -| a numer|
|000050d0| 69 63 20 76 61 72 69 61 | 62 6c 65 0d 0a 0d 0a 20 |ic varia|ble.... |
|000050e0| 20 20 20 20 54 68 65 20 | 70 72 6f 67 72 61 6d 20 | The |program |
|000050f0| 69 73 20 74 6f 20 70 72 | 6f 64 75 63 65 20 61 20 |is to pr|oduce a |
|00005100| 6c 69 73 74 20 62 79 20 | 64 65 69 74 79 20 73 68 |list by |deity sh|
|00005110| 6f 77 69 6e 67 20 64 65 | 69 74 79 20 6e 61 6d 65 |owing de|ity name|
|00005120| 2c 20 68 6f 75 72 6c 79 | 0d 0a 20 20 20 20 20 72 |, hourly|.. r|
|00005130| 61 74 65 2c 20 68 6f 75 | 72 73 20 77 6f 72 6b 65 |ate, hou|rs worke|
|00005140| 64 2c 20 61 6e 64 20 70 | 61 79 2e 20 20 54 68 65 |d, and p|ay. The|
|00005150| 20 6f 75 74 70 75 74 20 | 66 6f 72 6d 61 74 20 69 | output |format i|
|00005160| 73 20 61 73 20 66 6f 6c | 6c 6f 77 73 3a 0d 0a 0d |s as fol|lows:...|
|00005170| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00005180| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 59 45 | | YE|
|00005190| 20 4f 4c 44 45 20 50 41 | 59 52 4f 4c 4c 0d 0a 20 | OLDE PA|YROLL.. |
|000051a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000051b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 3d 3d 3d 3d | | ====|
|000051c0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 0d 0a 20 20 20 |========|===.. |
|000051d0| 20 20 44 45 49 54 59 20 | 20 20 20 20 20 20 20 20 | DEITY | |
|000051e0| 20 20 20 48 4f 55 52 53 | 20 20 20 20 20 20 20 20 | HOURS| |
|000051f0| 20 20 20 20 20 20 20 20 | 20 20 20 48 4f 55 52 4c | | HOURL|
|00005200| 59 20 20 20 20 20 20 20 | 20 20 20 20 54 4f 54 41 |Y | TOTA|
|00005210| 4c 0d 0a 20 20 20 20 20 | 4e 41 4d 45 20 20 20 20 |L.. |NAME |
|00005220| 20 20 20 20 20 20 20 20 | 20 57 4f 52 4b 45 44 20 | | WORKED |
|00005230| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005240| 20 52 41 54 45 20 20 20 | 20 20 20 20 20 20 20 20 | RATE | |
|00005250| 20 20 20 50 41 59 0d 0a | 20 20 20 20 20 2d 2d 2d | PAY..| ---|
|00005260| 2d 2d 20 20 20 20 20 20 | 20 20 20 20 20 20 2d 2d |-- | --|
|00005270| 2d 2d 2d 2d 20 20 20 20 | 20 20 20 20 20 20 20 20 |---- | |
|00005280| 20 20 20 20 20 20 2d 2d | 2d 2d 2d 2d 20 20 20 20 | --|---- |
|00005290| 20 20 20 20 20 20 20 2d | 2d 2d 2d 2d 2d 0d 0a 20 | -|-----.. |
|000052a0| 20 20 20 20 4e 45 50 54 | 55 4e 45 20 20 20 20 20 | NEPT|UNE |
|000052b0| 20 20 20 20 20 2e 2e 2e | 2e 2e 20 20 20 20 20 20 | ...|.. |
|000052c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2e 2e 2e | | ...|
|000052d0| 2e 2e 2e 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |... | |
|000052e0| 2e 2e 2e 2e 2e 0d 0a 20 | 20 20 20 20 2e 2e 2e 2e |....... | ....|
|000052f0| 2e 0d 0a 0d 0a 20 20 20 | 20 20 54 65 73 74 20 64 |..... | Test d|
|00005300| 61 74 61 20 73 69 20 74 | 68 65 20 66 6f 6c 6c 6f |ata si t|he follo|
|00005310| 77 69 6e 67 3a 0d 0a 0d | 0a 20 20 20 20 20 4e 61 |wing:...|. Na|
|00005320| 6d 65 20 20 20 20 20 20 | 20 20 20 48 6f 75 72 73 |me | Hours|
|00005330| 20 20 20 20 20 20 20 20 | 20 20 20 52 61 74 65 0d | | Rate.|
|00005340| 0a 0d 0a 20 20 20 20 20 | 4e 65 70 74 75 6e 65 20 |... |Neptune |
|00005350| 20 20 20 20 20 20 33 30 | 20 20 20 20 20 20 20 20 | 30| |
|00005360| 20 20 20 20 20 31 32 2e | 35 30 0d 0a 20 20 20 20 | 12.|50.. |
|00005370| 20 41 74 6c 61 73 20 20 | 20 20 20 20 20 20 20 31 | Atlas | 1|
|00005380| 35 20 20 20 20 20 20 20 | 20 20 20 20 20 20 32 32 |5 | 22|
|00005390| 2e 30 30 0d 0a 20 20 20 | 20 20 53 61 74 79 72 20 |.00.. | Satyr |
|000053a0| 20 20 20 20 20 20 20 20 | 20 34 20 20 20 20 20 20 | | 4 |
|000053b0| 20 20 20 20 20 20 20 20 | 38 2e 30 30 0d 0a 20 20 | |8.00.. |
|000053c0| 20 20 20 46 72 65 64 20 | 20 20 20 20 20 20 20 20 | Fred | |
|000053d0| 31 34 32 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |142 | |
|000053e0| 35 30 2e 30 30 0d 0a 0d | 0a 20 20 20 20 20 4d 61 |50.00...|. Ma|
|000053f0| 6b 65 20 73 75 72 65 20 | 79 6f 75 20 68 61 76 65 |ke sure |you have|
|00005400| 20 61 20 66 6c 6f 77 63 | 68 61 72 74 20 66 6f 72 | a flowc|hart for|
|00005410| 20 74 68 65 20 61 62 6f | 76 65 20 61 6e 64 20 74 | the abo|ve and t|
|00005420| 68 61 74 20 61 6c 6c 20 | 63 6f 64 65 20 69 73 20 |hat all |code is |
|00005430| 69 6e 0d 0a 20 20 20 20 | 20 73 74 72 75 63 74 75 |in.. | structu|
|00005440| 72 65 64 20 42 41 53 49 | 43 2e 0d 0a 0d 0a 0d 0a |red BASI|C.......|
|00005450| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|00005460| 0d 0a 0d 0a 0d 0a 0d 0a | 20 20 20 20 20 20 20 20 |........| |
|00005470| 20 20 20 20 20 20 20 20 | 20 1b 45 20 20 20 20 20 | | .E |
|00005480| 20 20 20 20 20 20 20 20 | 20 20 20 1b 46 20 20 20 | | .F |
|00005490| 20 20 1b 45 20 20 32 32 | 0d 0a 0d 0a 1b 46 20 0d | .E 22|.....F .|
|000054a0| 0a 1b 32 1b 55 00 1b 39 | 0c 1b 48 1a 20 20 20 20 |..2.U..9|..H. |
|000054b0| 20 20 20 20 20 2e 2e 2e | 2e 2e 20 20 20 20 20 20 | ...|.. |
|000054c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2e 2e 2e | | ...|
|000054d0| 2e 2e 2e 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |... | |
|000054e0| 2e 2e 2e 2e 2e 0d 0a 20 | 20 20 20 20 2e 2e 2e 2e |....... | ....|
|000054f0| 2e 0d 0a 0d 0a 20 20 20 | 20 20 54 65 73 74 20 64 |..... | Test d|
|00005500| 61 74 61 20 73 69 20 74 | 68 65 20 66 6f 6c 6c 6f |ata si t|he follo|
|00005510| 77 69 6e 67 3a 0d 0a 0d | 0a 20 20 20 20 20 4e 61 |wing:...|. Na|
|00005520| 6d 65 20 20 20 20 20 20 | 20 20 20 48 6f 75 72 73 |me | Hours|
|00005530| 20 20 20 20 20 20 20 20 | 20 20 20 52 61 74 65 0d | | Rate.|
|00005540| 0a 0d 0a 20 20 20 20 20 | 4e 65 70 74 75 6e 65 20 |... |Neptune |
|00005550| 20 20 20 20 20 20 33 30 | 20 20 20 20 20 20 20 20 | 30| |
|00005560| 20 20 20 20 20 31 32 2e | 35 30 0d 0a 20 20 20 20 | 12.|50.. |
|00005570| 20 41 74 6c 61 73 20 20 | 20 20 20 20 20 20 20 31 | Atlas | 1|
|00005580| 35 20 20 20 20 20 20 20 | 20 20 20 20 20 20 32 32 |5 | 22|
|00005590| 2e 30 30 0d 0a 20 20 20 | 20 20 53 61 74 79 72 20 |.00.. | Satyr |
|000055a0| 20 20 20 20 20 20 20 20 | 20 34 20 20 20 20 20 20 | | 4 |
|000055b0| 20 20 20 20 20 20 20 20 | 38 2e 30 30 0d 0a 20 20 | |8.00.. |
|000055c0| 20 20 20 46 72 65 64 20 | 20 20 20 20 20 20 20 20 | Fred | |
|000055d0| 31 34 32 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |142 | |
|000055e0| 35 30 2e 30 30 0d 0a 0d | 0a 20 20 20 20 20 4d 61 |50.00...|. Ma|
|000055f0| 6b 65 20 73 75 72 65 20 | 79 6f 75 20 68 61 76 65 |ke sure |you have|
+--------+-------------------------+-------------------------+--------+--------+