Chapter
10
1
BASIC
Keywords
Sample Program
420
CLS:
A$
=
'I**$##,######.##
DOLLARS"
430
INPUT "WHAT IS YOUR FIRST NAME";
F$
440
INPUT "WHAT IS YOUR MIDDLE NAME";
M$
450
INPUT "WHAT IS YOUR LAST NAME".
L$
460
INPUT "ENTER AMOUNT PAYABLE";
b
470
CLS
:
PRINT "PAY TO THE ORDER
OF
'I;
480
PRINT USING
"!!
!!
'I;
FS;
'I.";
MB;
"
0,
'I.
490
PRINT LF
500
PRINT :PRINT USING
A$;
P
In Line
480,
each
!
picks up the
first
character
of
one of the fol-
lowing strings
(F$,
".",
M$,
and
"."
again). Notice the
2
spaces in
"!!b!!b".
These
2
spaces insert the appropriate spaces after the
initials of the name (see below). Also notice the use of the vari-
ables A$ for format and
P
for item list in Line
500.
Any serious
use
of
the PRINT USING statement would probably require the
use
of
variables rather than constants, at least for data items.
(We have used constants in our examples for the sake
of
better
illustration.)
When the program above
is
run, the display shows:
WHAT IS YOUR FIRST NAME? JOHN
WHAT IS YOUR MIDDLE NAME? PAUL
WHAT IS YOUR LAST NAME? JONES
ENTER AMOUNT PAYABLE?
12345.6
PAY TO THE ORDER
OF
J.
P. JONES
*****$12,345.60
DOLLARS
275