LEXIBOOK GC500i Instruction Manual page 60

Graphic calculator
Table of Contents

Advertisement

GB
Main routine
P0
Prog 3
Prog 2
The subroutine command is "Prog" followed by a number from 0 through 9 which indicates the program
area.
Example :
Prog 0 ......... Jump to program area 0
Prog 2. ........ Jump to program area 2
After the jump is performed using the Prog. command, execution continues from the beginning of the
program stored in the specified program area. After execution reaches the end of the subroutine, the
program returns to the statement following the Prog n command in the original program area. Jumps can
be performed from one subroutine to another, and this procedure is known as "nesting". Nesting can be
performed to a maximum of 10 levels, and attempts to exceed this limit will cause an error (Ne ERROR)
to be generated. Attempting to use Prog to jump to a program area in which there is no program stored will
also result in an error (Go ERROR).
*** A Goto n contained in a subroutine will jump to the corresponding Lbl n contained in that program
area.
Example: Simultaneously execute the two previously presented programs to calculate the surface
areas and volumes of a regular octahedron and tetrahedron.
Express the result in three decimal places.
This example employs two previously explained programs, and the first step is to input the specified
number of decimal places (
Now let's review the two original program.
Regular octahedron
P0
Regular tetrahedron
P1
If the two programs are compared, it is evident that the underlined portions are identical. If these portions
are incorporated into a common subroutine, the programs are simplified and the number of steps required
is decreased.
Furthermore, the portions indicated by the wavy line are not identical as they stand, but if P1 is modified
to: √, 2, ÷, 3, x, A, x
Now the portions underlined by the straight line will be stored as an independent routine in P9 and those
underlined with the wavy line will be stored in P8.
P9
P8
After the common segments have been removed, the remainder of the regular octahedron formula is stored
in P0, and that of the regular tetrahedron is stored in P1. Of course, the "Prog 9" and "Prog 8" must be
added to jump to subroutines P9 and P8.
P0
P1
With this configuration, execution jumps to program P9 at the beginning of programs P0 and P1, three
decimal places are specified, the value for one side is entered, and the surface area of the tetrahedron is
calculated. The expression "2x" of the original octahedron formula was omitted in P9, so when execution
returns to P0, "Ansx2" is used to obtain the surface of the octahedron.
- 60 -
Level 1
Level 2
3)
MODE
7
Fix, 3, :, ?, →, A, :, 2, x, √, 3, x, A, x
√, 2, ÷, 3, x, A, xy, 3
Fix, 3, :, ?, →, A, :, √, 3, x, A, x2,
√, 2, ÷, 1, 2, x, A, x
, 3
y
, 3, ÷, 4, the two portions become identical.
y
Fix, 3, :, ?, →, A, :, √, 3, x, A, x
,
2
√, 2, ÷, 3, x, A, xy, 3
Prog, 9, :, Ans, x, 2,
, Prog, 8
, Prog, 8, :, Ans, ÷, 4
Prog, 9,
Level 3
Level 4
,
,
2
23 steps
,
22 steps
Total: 45 steps
12 steps
8 steps
9 steps
9 steps
Total: 38 steps
Copyright L
EXIBOOK
2002

Advertisement

Table of Contents
loading

This manual is also suitable for:

Gc1000i

Table of Contents