HP Forums

Full Version: (11C) Compound Calculations
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This program calculate compound solutions.
Provide any three out of four variables for the result of the remaining variable for
[n] [i] [PV] [FV]

LBL A for [n] period
LBL B for [i] interest
LBL C to Reset
LBL D for [PV] Present Value
LBL E for [FV] Future Value

Remark:
Each input data indicate as 0.00 on display with FIX 2
This program didn't use sign convention where money paid out is negative.

Example: switch to USER mode f USER
10 > A > 0.00 (Store [n])
10 > B > 0.00 (Store [i])
1000 > C > 0.00 (Store [PV])

remaining variable is [FV]
E > 2593.74 is the answer for [FV]

If [i] change to 7 what is the [FV]

7 > B > 0.00 (Store new [i])
E > 1967.15 (answer for new [FV] when [i] is 7%)

To start a new problem: LBL C to Reset

Program:
Code:

LBL A    // [n]
STO 1
0
X≠Y
RTN
RCL 5
RCL 4
/
LN
RCL 2
1
+
LN
/
STO 1
RTN
LBL B    // [i]
EEX
2
/
STO 2
0
X≠Y
RTN
RCL 5
RCL 4
/
RCL 1
1/x
Y^X
1
-
STO 2
EEX
2
x
RTN
LBL D    // [PV]
STO 4
0
X≠Y
RTN
RCL 5
RCL 2
1
+
RCL 1
Y^X
/
STO 4
RTN
LBL E    // [FV]
STO 5
0
X≠Y
RTN
RCL 4
RCL 2
1
+
RCL 1
Y^X
x
STO 5
RTN
LBL C    // Reset
CLx
STO 1
STO 2
STO 4
STO 5
FIX 2
RTN

Gamo
(04-10-2018 12:21 PM)Gamo Wrote: [ -> ]Provide any three out of four variables for the result of the remaining variable ...

That's a nice program and, as far as I can tell, it seems to work correctly.

But you should remove this line from the example:

(04-10-2018 12:21 PM)Gamo Wrote: [ -> ]Answer of [FV] 2593.74 on display > input to [FV] > E > 0.00

Unlike the previous pricing program, this one does store a calculated result in the respective register. So you do not have to re-enter it if you want to continue with this value.

In this example a new input isn't required even if the result had not been stored. You just have calculated FV, and now you change the interest rate to calculate a new FV. So the old one is overwritten anyway. You do not need the old FV to calculate a new one. ;-)

(04-10-2018 12:21 PM)Gamo Wrote: [ -> ]Program:
Code:
...
LBL C    // Reset
REG
CLx
RTN

The code looks very good. However, if possible, I would avoid clearing all registers. This way the user loses all data he may have stored. So it's always a good idea to clear only the required registers. At least on a calculator with constant memory.

Code:
...
LBL C    // Reset
CLx
STO 1
STO 2
STO 4
STO 5
FIX 2
RTN

Dieter
Thank You Dieter

Updated the instruction and program. Smile

Gamo
Reference URL's