Entering and executing programs, Entering and executing programs -5, A program – HP 48g Graphing Calculator User Manual

Page 411

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

Advertising
background image

program you can use branching structures to control the execution
flow.)

You can take advantage of structured programming by creating

“building-block” programs. Each building-block program can stand

alone—and it can act like a subroutine in a larger program. For

example, consider the following program:

« G E T V fiL L IE C fiL C L IL H T E S H u W fiH S W E R »

This program is separated into three main tasks, each with a

subroutine. The flow is predictable. Only the input and output of
each subroutine matter—the internal workings don’t matter at this

level.

Within each subroutine, its task can be simple—or it can be

subdivided further into other subroutines that perform smaller tasks.

This lets you have relatively simple subroutines—even if your main
program is large.

So, programs become extensions to the set of built-in commands, as

mentioned earlier. You execute them by name. They take certain
inputs, and they produce certain results.

Entering and Executing Programs

A program is an object—it occupies one level on the stack, and you
can store it in a variable.

To

enter

a program:

1. Press Q£3- The

P R G

annunciator appears, indicating

Program-entry mode is active.

2. Enter the commands and other objects (with appropriate

delimiters) in the required order for the operations you want the

program to execute.

a

Press

fSPC

) to separate consecutive numbers,

a

Press to move past closing delimiters.

3. Optional; Press (5)1®) (newline) to start a new line in the

command line at any time.

4.

Press

(

enter

)

to put the program on the stack.

29

Programming the HP 48 29-5

Advertising
This manual is related to the following products: