The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





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

Procedure:

First Item follow by Second Item

(1st) Price [ENTER] Quantity [ENTER]
(2nd) Price [ENTER] Quantity [R/S] --> 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 [ENTER] 2.15 [ENTER] 17 [R/S] display 1

Answer: Item #1 is cheaper than Item #2

Program:
Code:

01  ÷
02 STO 1
03 Rv
04  ÷
05 STO 2
06 X<>Y
07 Rv
08  -
09 X=0
10 GTO 19
11 RCL 2
12 RCL 1
13 X≤Y 
14 GTO 17
15  1
16 GTO 00
17  2
18 GTO 00
19  3
20 GTO 00

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


Messages In This Thread
(12C) Lowest Unit Cost - Gamo - 11-19-2018 06:30 AM



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