Post Reply 
(11C) Lowest Unit Cost
11-17-2018, 10:32 AM
Post: #1
(11C) Lowest Unit Cost
Program for budget minded shoppers that repeatedly choose the least
costly (lowest unit cost) of equivalent items.

Procedure:

First Item: Price [ENTER] Quantity [A] display 1
Second Item: Price [ENTER] Quantity [B] display 2

[C] Answer

If First Item is cheaper display answer shown -1
If Second Item is cheaper display answer show -2
If both are equal display answer show 3

Example:

Item #1
13 ounces at $1.63
Item #2
17 ounces at $2.15

1.63 ENTER 13 [A] display 1 // Item #1
2.15 ENTER 17 [B] display 2 // Item #2

[C] display -1 // Item #1 is cheaper

Program:
Code:

LBL A
÷
STO 1
1
RTN
-------------
LBL B
÷
STO 2
2
RTN
--------------
LBL C
RCL 1
RCL 2
X>Y
GTO 1
X=Y
GTO 2
2
CHS
RTN
--------------
LBL 1
1
CHS
RTN
--------------
LBL 2
3
RTN

Gamo
Find all posts by this user
Quote this message in a reply
Post Reply 




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