Getting, Started, Introduction – HP 49g Graphing Calculator User Manual

Page 188

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

Advertising
background image

Introduction

This chapter describes how to create and nm programs on the HP 49G.
The HP 49G has a rich programming environment. Programs can range in

complexity from a simple task such as performing a sequence of

arithmetic operations, to a complex process that requests input, performs

extensive processing, and outputs results in a graphical fonnat.

This chapter focuses on creating aird running programs in algebraic mode

only. See the Advanced User’s Guide for infonnation on creating and
using programs in RPN mode. See the Pocket Gu ide for details of the

programming commands that are available.

Getting

started

This section contains an example of how to create a simple program to

calculate the hypotenuse of a right-angle triangle, using Pythagoras’

theorem. When you start the program, you supply the known side lengths
as argiunents.

This program is an example of a simple algebraic calculation using the

arguments that you specify. Within the program, the calculation is
enclosed in single quotes (0O) to delimit it as an algebraic object. If you

need to do extensive processing involving looping and branching, you use

a nested procedure (0iE3) to delimit the procedure from the arguments.

The program does the following:

* It collects the known side lengths as arguments and stores them as

local variables, that is, variables that exist only while the program is

rimning.

® It uses the variables to calculate the length of the hypotenuse, and

returns the result to the history.

Create the program as follows:

1. Put the program delimiters on the command line.

2. Define the two local variables to accept the arguments for the side

length.

« ^ A B »

Page 10-2

Introduction to programming

Advertising