Result
Application
#1
Calculator
This application program converts your computer into a calculator.
Insert the cassette containing the Calculator program
in
your cassette recorder.
Rewind the cassette
if
necessary.
Clear memory with the NEW command
and
then load the calculator program by
pressing PLAY on the recorder and entering the command:
CLOAO
"CALC"
List the program and compare it to Figure
1-1
to verify that it loaded correctly. Save
the program in a RAM file by entering the command:
SAVE
"CALC"
For convenience, you may also wish to save the calculator program on a separate
cassette. Use the command
CSAVE
"CALC"
to
write the program to a blank cassette.
This program allows you to use your Computer
as
a calculator. This means that
numbers may be added, subtracted, multiplied or divided
as
they are entered from the
keyboard, without having to include them
as
an
expression in a PRINT statement.
Execute the program. There will be no visual indication that anything has happened.
However,
if
you type the following sequence:
2+3;;;
you will see that the result
is
immediately displayed:
2+3=
5
Notice that this is exactly the way you would enter data to be added on a calculator.
Try the following simple calculations:
Press keys
in
this order
9-2=
3.25*7=
-1/3=
5*6-9.3=
4"2=
2+3*4=
2+(3*4)=
(2
+ 3)/(2.5*4) =
11((1
+ (.5"( - 2»)/(1 +
.5»)
=
7
22.75
-.33333333333333
20.7 (30 minus 9.3)
16
(4
to the 2nd power)
20
(5
times
4)
14
(2
piUS
12)
.5
(5
divided by 10)
.3
(1
divided by 3.333
...
)
Notice that exponentiation and parentheses are both supported. Keep
in
mind that the
calculator computes the result immediately
as
each of the operators
is
entered. The
equal sign
(=)
prints the result.
185