Post Reply 
(41) Profit on Pricing Solver
12-29-2019, 05:51 AM (This post was last modified: 01-02-2020 02:04 AM by Gamo.)
Post: #1
(41) Profit on Pricing Solver
Profit on Pricing is based on four data.
1. Cost
2. Selling Price
3. Markup
4. Margin

User provide two known data and program will find the two remaining unknown.
The only exception is that the two known data cannot be Markup with Margin.
But Markup and Margin can be calculate by itself between it.

Assign each Cost, Price, Markup and Margin to the top row keys from left to right.

To assing key:
f [ASN] COST [A] // Sigma + key
f [ASN] PRICE [B] // 1/x key
f [ASN] Markup [C] // Square Root key
f [ASN] Margin [D] // LOG key
f [ASN] RESET [E] // LN key

Example: [USER] [FIX] 2

Cost 88 and Margin 20 what is Price and Markup?

[E] display 0.00 // This use for clearing register 1 to 4 and Initialize.

88 [A] display 88.00 // Press and hold not more than 1 second will show COST monentary on display
20 [D] display 20.00 // Press and hold on other remaining keys will show Name of that Labels.
[B] display 110.00 // Price
[C] display 25.00 // Markup

Remark:
Example above user can go to [C] then [B] as well.
[A] [D] to [B] [C] or [C] [B]

Program:
Quote:01 LBL COST
02 STO 01
03 FS?C 22 // This flag enter manually in program mode
04 RTN
05 CLx
06 STO 01
07 XEQ 00
08 RCL 02
09 1
10 RCL 03
11 %
12 +
13 /
14 RTN
-------------
15 LBL PRICE
16 STO 02
17 FS?C 22 // This flag enter manually in program mode
18 RTN
19 CLx
20 STO 02
21 XEQ 00
22 RCL 01
23 RCL 03
24 %
25 +
26 RTN
-------------
27 LBL MARKUP
28 STO 03
29 FS?C 22 // This flag enter manually in program mode
30 RTN
31 CLx
32 STO 03
33 CF 00 // This flag enter directly from the key pad
34 GTO 03
35 LBL 04
36 RCL 02 // Calculate Margin
37 RCL 01
38 %CH
39 CHS
40 RTN
-------------
41 LBL MARGIN
42 STO 04
43 FS?C 22 // This flag enter manually in program mode
44 RTN
45 CLx
46 STO 04
47 SF 00 // This flag enter directly from the key pad
48 LBL 03
49 RCL 01
50 X=0? // Cost Unknown?
51 GTO 00
52 RCL 02
53 X=0? // Price Unknown?
54 GTO 00
55 FS? 00 // This flag enter directly from the key pad
56 GTO 04
57 RCL 01 // Calculate Markup
58 RCL 02
59 %CH
60 RTN
---------------
61 LBL 00
62 RCL 03
63 X=0? // Is Markup unknown?
64 GTO 01
65 CF 01 // This flag enter directly from the key pad
66 GTO 02
67 LBL 05
68 -
69 1/x
70 STO 03
71 RTN
--------------
72 LBL 01
73 RCL 04
74 SF 01 // This flag enter directly from the key pad
75 LBL 02
76 1/x
77 1 E-2 // EEX 2 CHS
78 FS? 01 // This flag enter directly from the key pad
79 GTO 05
80 +
81 1/x
82 RTN
-------------
83 LBL RESET
84 CLx
85 STO 01
86 STO 02
87 STO 03
88 STO 04
89 RTN

Gamo 12/29/2019
Find all posts by this user
Quote this message in a reply
12-29-2019, 03:21 PM
Post: #2
RE: (41) Profit on Pricing Solver
You could save some space and avoid having to assign to programs to keys by using labels A-E instead of the COST, PRICE, MARGIN, MARKUP and RESET. Also, should RESET clear flag 00? That would only be necessary if a path assumes it's clear rather than clearing it explicitly.

Thanks for posting. I saw your 65 version on facebook and tried writing my own version. It's at least 25% longer than yours Sad.

Dave
Find all posts by this user
Quote this message in a reply
12-30-2019, 03:37 AM (This post was last modified: 12-30-2019 05:07 AM by Gamo.)
Post: #3
RE: (41) Profit on Pricing Solver
Thank You Dave

Thanks for the review.

The algorithm use is by attemping to find the Markup.
The key to all the answer is first to get the answer for Markup.
If the unknown is Markup then the special formula is use to
convert Margin to Markup and if the Markup is known this same
special fourmula will get the Margin as well.
The flags is very important in this type of problem since user can
enter data in many combination pair of data and still get the answer.
The flowchart is available in the HP-12C link provided below.

I intended to use alpha labels because
when press and hold the key for less than a second
display will show that label name effect.

The flags used in program seem to work anytime
even though the new problem is enter without clearing flags.
The RESET option is only use for clearing the data registers.

The reason that I write this program because HP-12C doesn’t include
this function where most Financial Calculator have it.
I also write this program for 12C too, but to enter data user must
fill the four data in stacks and run. The answer will be in the TVM labels.
To see the answer simply recall TVM label.

https://www.hpmuseum.org/forum/thread-13043.html

My first HP calculator is the HP 10BII and it got this Pricing Calculation feature.
This program work better than the 10BII because it can calculate between
Markup and Margin by itself.

I’m very thankful to Dieter who help make this program possible.

Gamo
Find all posts by this user
Quote this message in a reply
05-12-2020, 04:45 AM (This post was last modified: 05-25-2020 07:30 AM by Gamo.)
Post: #4
RE: (41) Profit on Pricing Solver
Updated Profit on Pricing Solver now adapted to work on Free42 the HP-42S Simulator App.

This update program came with the Soft Menu on display with Beep and Tone on

each of the key press depending on different combinations of keys press sequences

the audible sound out different tone for interactive purpose and kind of more fun to use....maybe.

Video Clip link: https://youtu.be/edcJrEYXR7g

Remark:
The program listing is in the description and user need to add the Soft Menu individually.
For the audible sound recommend to use Tone 0 to 5 on each of the Label 00 to 05 and
use Beep sound on each of the program ending for smoother sound melody.

This Profit on Pricing program can also be use as a [TAX+] and [TAX-] by using only
Three keys on [COST] [PRICE] and [MARKUP]
To calculate for an item including tax input item amount to [COST] and Tax% to [MARKUP] and answer out to [PRICE]
To calculate for an item without tax input item amount to [PRICE] if same tax as above go ahead to got answer out to [COST]

Gamo 5/12/2020
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)