20060301
Modifying an Exi
s
ting Program to Create a New One
You can use the procedure described below to recall an existing program, modify it, and then
run the result as a new program. This helps reduce key input requirements.
The following shows how to modify the “OCTA” program we created on page 12-2-1 to
handle tetrahedrons.
Example:
To create a program named “TETRA” that calculates the surface areas (cm
2
) and
volumes (cm
3
) of three regular tetrahedrons, the lengths of whose sides are 7, 10,
and 15 cm
The following formulas calculate the surface area S and volume V of a
regular tetrahedron for which the length of one side A is known.
The following is the program required for this example.
Length of One Side A ..........Input A
Surface Area S ....................Print approx(
(3)
s
A^2)
Volume V ............................Print approx(
(2)
w
12
s
A^3)
The following is the “OCTA” program (page 12-2-1).
Length of One Side A ..........Input A
Surface Area S ....................Print approx(2
s
(3)
s
A^2)
Volume V ............................Print approx(
(2)
w
3
s
A^3)
A comparison of the two programs indicates that the following modifications of the “OCTA”
program will produce a program that performs the calculations required by this example.
• Delete “2
s
” (underlined with a wavy line above).
• Change 3 to 12 (underlined with double lines above).
S
Cla
ss
Pad Operation
(1) On the application menu, tap
1
.
(2)
Tap
}
, or tap [Edit] and then [Open File].
12-3-2
Debugging a Program
S = 3 A
2
, V
=
2
12
A
3
A
Summary of Contents for ClassPad 330
Page 11: ...20060301 20090601 ClassPad 330 ClassPad OS Version 3 04 ...
Page 277: ...20060301 3 3 10 Storing Functions 3 Tap AND Plot OR Plot ...
Page 779: ...20090601 S Graph Line Clustered C S Graph Line Stacked E 13 9 2 Graphing ...
Page 780: ...20090601 S Graph Line 100 Stacked F S Graph Column Clustered G 13 9 3 Graphing ...
Page 781: ...20090601 S Graph Column Stacked I S Graph Column 100 Stacked J 13 9 4 Graphing ...
Page 782: ...20090601 S Graph Bar Clustered K S Graph Bar Stacked 9 13 9 5 Graphing ...