IBM 5110 Basic Introduction page 39

Table of Contents

Advertisement

'"
(
"'."
..
' .
(
'.",'.'
~,
c
You will recognize the prompting message INITIAL PRINCIPAL? as part
of the second statement in the sample program. This is a PRINT
statement, which directs information to be displayed.
Note that the bottom question mark is flashing. The flashing question
mark is a result of the INPUT statement in the sample program. The
INPUT statement causes the question mark to be flashed to indicate
that you are to enter information from the keyboard for the program.
Now respond to the request for data to be entered by keying a value
for initial principal, then press EXECUTE. You can enter any number of
digits you want. The maximum number of significant digits that the
system will assign to any variable (your variable is P for principal) is 15
digits. You can include a decimal point, which does not count as a
digit entry, but you must not enter commas. (Commas indicate
multiple variables to the system.)
If you enter a decimal number with more than six digits to the right of
the decimal point, any digits beyond the sixth are rounded when the
answer for savings is displayed. The system is initialized to round
numbers at the sixth decimal position. However, the rounding position
can be changed to any position from 1 to 15 with the RD= command,
which sets the rounding position. To set the system to round all
displayed or printed results and calculations at the second decimal
position, you would enter: RD=2.
The rounding command can also be included with the GO and RUN
commands as described in the IBM 5110 BASIC Reference Manual,
SA21-930B. Remember that whenever you turn the power on or press
RESTART, the rounding position is set at 6.
All examples in this manual are run with the rounding position set to 6
digits (RD=6). If you change the rounding position, different results
will be displayed.
You must remember that when using any programming language,
including BASIC, you are communicating with the machine, telling it
what you want it to do. Thus, you should define precisely what the
machine does not know to avoid unnecessary problems.
You can enter values for the accumulated savings program as many
times as you want. After you enter values for interest and years in
response to the flashing question mark and press EXECUTE, the
system will display the information you specified and compute the
answer.
Entering, Running, and Storing a Program
35
'"
(
"'."
..
' .
(
'.",'.'
~,
c
You will recognize the prompting message INITIAL PRINCIPAL? as part
of the second statement in the sample program. This is a PRINT
statement, which directs information to be displayed.
Note that the bottom question mark is flashing. The flashing question
mark is a result of the INPUT statement in the sample program. The
INPUT statement causes the question mark to be flashed to indicate
that you are to enter information from the keyboard for the program.
Now respond to the request for data to be entered by keying a value
for initial principal, then press EXECUTE. You can enter any number of
digits you want. The maximum number of significant digits that the
system will assign to any variable (your variable is P for principal) is 15
digits. You can include a decimal point, which does not count as a
digit entry, but you must not enter commas. (Commas indicate
multiple variables to the system.)
If you enter a decimal number with more than six digits to the right of
the decimal point, any digits beyond the sixth are rounded when the
answer for savings is displayed. The system is initialized to round
numbers at the sixth decimal position. However, the rounding position
can be changed to any position from 1 to 15 with the RD= command,
which sets the rounding position. To set the system to round all
displayed or printed results and calculations at the second decimal
position, you would enter: RD=2.
The rounding command can also be included with the GO and RUN
commands as described in the IBM 5110 BASIC Reference Manual,
SA21-930B. Remember that whenever you turn the power on or press
RESTART, the rounding position is set at 6.
All examples in this manual are run with the rounding position set to 6
digits (RD=6). If you change the rounding position, different results
will be displayed.
You must remember that when using any programming language,
including BASIC, you are communicating with the machine, telling it
what you want it to do. Thus, you should define precisely what the
machine does not know to avoid unnecessary problems.
You can enter values for the accumulated savings program as many
times as you want. After you enter values for interest and years in
response to the flashing question mark and press EXECUTE, the
system will display the information you specified and compute the
answer.
Entering, Running, and Storing a Program
35

Advertisement

Table of Contents
loading

Table of Contents