beautypg.com

Creating, saving, and running a program, Creating, saving, and running a program -3, A-2+b-2) – HP 49g Graphing Calculator User Manual

Page 189

Attention! The text in this document has been recognized automatically. To view the original document, you can use the "Original mode".

background image

3. Define the equation to calculate the hypotenuse.

Note that you need to use O to enclose the equation and separate it

from the definition of the arguments.

0O®00{S®A©2

0(AfflA)B©2

« ^ A B

' r

(A-2+B-2) ■ »

4. Move the cursor out of the program and specify that you want to store

the program as “PYTH”.

00(ST0iI[©iIPHA)PYTH «

-»A B

'

5. Press (ENTER) to store the program.

( A ^ 2 + B ^ 2 ) ' »

V

P Y T H

Wlien you rim the program, you specify the lengths of the sides as

arguments to the program. For example, to run the program to calculate

the hypotenuse of a right angle triangle with sides of 3 and 4 units;

1. Display a list of the variables in the directory.

2. Press the fimction key that corresponds to your program. The program

name is inserted on the command line. Press 00 to insert

parentheses after the program name.

3. Enter yoiu- arguments, separated by a 0Q, between the parentheses.

3004

4. Press (ENTER) to calculate the hypotenuse.

The result is returned to history.

Creating, saving, and running a program

A program is an object that you can store in a variable. That is, you create

a program, assign it a name and save it in a directory.

• To create a program, press 0@. The program delimiters appear on

the command line ready for you to enter code, and the PEG

annunciator appears at the top of the screen to indicate that you are in

program mode.

Use the keyboard functions and keys, and select commands from the

programming menu, to create your program. As you select function

keys and operator keys, the fimctions and operations appear in your

program.

introduction to programming

Page 10-3