Subroutines - Singer Friden 1155 Operator's Primer

Advanced programmable calculator
Hide thumbs Also See for Friden 1155:
Table of Contents

Advertisement

9/72
23
SUBROUTINES
Let f(x)
=
x 3 + x
2
+
X
+ 1
The following is a program to compute the value of f(x) for a given value of x.
10
++858
SPACE
STOP
PRINT
STORE 19
3
A TO X
RECALL 19
X SQ
+
RECALL 19
+
1
+
PRINT
GO TO 10
This part of the program does the actual
1 - - - - - - work of computing f(x). At the beginning
of this section, x is in L. At the end,
f(x) is
in
L.
PROBLEM 1:
Given a and b, compute u, where
PROBLEM 2:
u
=
(a 3 + a
2
+ a + 1)(b3 + b
Z
+ b + 1)
=
f(a) f(b)
Given a, band c compute v, where
v
=
(a 3 + a
2
+ a + 1)(b 3 + b
2
+ b + 1)(c 3 + c
2
+
C
+ 1)
=
f(a) f(b) f(c)
A program to solve PROBLEM 1 is shown on the following page. The program
consists of a subroutine
to
compute f(x) and a main program which calls (uses)
the subroutine twice.
23-1

Advertisement

Table of Contents
loading

Table of Contents