Showing posts with label sales tax. Show all posts
Showing posts with label sales tax. Show all posts

Sunday, December 24, 2023

TI-73 (Explorer): Percents and Random Fractions

TI-73 (Explorer):  Percents and Random Fractions



TI-73 Program:  PERCENT





TAX+:  Appropriately add a percent to a number.   Application:  Sales Tax


TAX-:   Appropriately subtract a percent from a number.  Application:  Discount


% CHANGE:  Percent change from the old number to new number.  Additional application:  Percent Markup (OLD = cost, NEW = selling price)


%TOT:  Finds the percentage portion of a total number


% MARGIN:  Given an item's cost and selling price, calculate the item's percent margin.  



Code:

(spaces added for clarity)


"EWS 2023-12-02"     // (comment)


Lbl 0

Menu("PERCENT","TAX+",1,"TAX-",2,

"% CHANGE",3,"%TOT",4,"% MARGIN",5,

"EXIT",E)


Lbl 1

Prompt N

Input "X% ",X

N*(1+X%)→Y

Disp "ANSWER="

Pause Y

Goto 0


Lbl 2

Prompt N

Input "X% ",X

N*(1-X%)→Y

Disp "ANSWER="

Pause Y

Goto 0


Lbl 3

Input "OLD=",O

Input "NEW=",N

(N-O)*100/O→Y

Disp "% CHANGE="

Pause Y

Goto 0


Lbl 4

Input "PART=",P

Input "WHOLE=",W

100*P/W→Y

Disp "%"

Pause Y

Goto 0


Lbl 5

Input "COST=",C

Input "SELL PRICE=",S

(S-C)/S*100→Y

Disp "% MARGIN="

Pause Y

Goto 0


Lbl E

Disp "BYE"

Pause



Note:   Results that are to be displayed need to be followed or accompanied by a Pause command, unless the results will not show.  This wrinkle is unique to the TI-73.  

Link to download PERCENT.73p



TI-73  Program:  RANDFRAC




Generate a number of fractions with randomized numerators and denominators.  


T = number of fractions to be generator

L = upper limit that the numerator and denominator can take.  The numbers range from 1 to L


The result is returned in three parts:


numerator

denominator

fraction


For example:


5

7

5/7


Simplification rules are set through the MODE key.  


Code:

(spaces added for clarity)


"EWS 2023-12-02"     // (comment)


Disp "NO. FRACTIONS"

Prompt T

Disp "UPPER LIMIT"

Prompt L


For(I,1,T)

randInt(1,L)→N

randInt(1,L)→D

N ⁄ D→F     // N [ b/c ] D [ STO> ] F

Disp N,D,F

Pause

End


Note:  The fraction symbol pressed by [ b/c ], symbolized by  ⁄, shows on the screen as a thick division slash.   


Link to download RANDFRAC.73p


For those of you who are celebrating, Merry Christmas!


Eddie


All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, April 2, 2023

Swiss Micros DM41X: Cash Register

Swiss Micros DM41X: Cash Register


Ready to Check Out? 


Download the program here (raw file):  https://drive.google.com/file/d/102ekvHr4c3shBY6RvAuAZzjj1g1ctD7L/view?usp=share_link


This program simulates a cash register.  If you have an HP infrared printer like the HP 82240B (from the 1980s and 1990s), the program is set to print the results. The printer is enabled by setting flag 21.   When a printer is present, flag 55 is set internally.   


When the printer flag is turned on (21):


AVIEW:   print what ever is in the alpha register

VIEW:  print the contents of a numeric register

ADV:  advances the paper


A printer is not required to run the program, unplug the Infrared Printer Module.  This way the program stops when an AVIEW, VIEW, and ADV instruction displays.  Press [ R/S ] to continue.


This program assumes every item entered is subject to a sales tax, which is set within the program, line 03.   



DM41X/HP41CX Program:  CASHREG


When you are done entering the costs for items checked out, enter zero.


01  LBL^T CASHREG

02  FIX 2

03  8.75    ← set your sales tax rate here 

04  STO 02

05  0

06  STO 01

07  SF 21   ← allows the calculator to print/display

08  ^T THE STORE

09  33

10  XTOA  ← ammends an exclamation point (!)

11  AVIEW

12  CLA

13  FIX 8

14  DATE

15  ADATE

16  AVIEW  ← prints the date

17  CLA

18  FIX 2

19  ADV

20  LBL 00   ← main loop

21  ^T COST?

22  PROMPT

23  X=0?

24  GTO 01

25  ARCL X

26  AVIEW

27  ST+ 01

28  GTO 00

29  LBL 01

30  ^T SUBTOTAL

31  ARCL 01

32  AVIEW

33  CLA

34  ARCL 02

35  ^T |- % TAX:

36  RCL 01

37  RCL 02

38  %

39  ARCL X

40  AVIEW

41  +

42  ^T TOTAL:

43  ARCL X

44  AVIEW

45  ^T PAID:

46  PROMPT

47  ARCL X

48  AVIEW

49  X<>Y

50  -

51  ^T CHANGE:

52  ARCL X

53  AVIEW

54  END



Example


Checkout:

$19.99

$27.95

$28.94

Sales Tax Rate:  8.75%

Paid: $100.00


XEQ CASHREG



THE STORE

01/29/2023   ←  the current date is shown here

COST?  19.99 R/S

COST?  27.95 R/S

COST?  28.94 R/S

COST?  0

SUBTOTAL: 76.88

8.75% TAX:  6.73

TOTAL:  83.61

PAID:  100 R/S

PAID:  100.00

CHANGE:  16.39



Eddie 



All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, August 23, 2020

Using Grand Total and Independent Memory for Complex Invoicing

Using Grand Total and Independent Memory for Complex Invoicing 

Introduction

Portable desktop (usually solar powered) calculators usually have at least two memory registers:  independent memory (M) and grand total (GT).  

Adding calculations to the independent memory by pressing the memory plus key    [ M+ ].  

Adding calculations to the grand total by pressing the equals key [ = ]. 

Invoice with Taxable and Nontaxable Items

We have an invoice that has items that are subject to sales tax, and items and services that are exempt from sales tax. 

Take advantage of both the independent and grand total memories to calculate the total invoice.

Two approaches:

[ ON/C ] to clear the grand total memory
[ MC ] (or press [ MRC ] until the independent memory is cleared) 

Method 1: 
taxable items [ M+ ]
nontaxable items [ = ]

After finishing entering all the items, add sales tax:
[ MR ] [ × ] sales tax rate [ % ] [ M+ ]

Calculate the total invoice:
[ MR ] [ = ] [ GRAND TOTAL ]

Method 2:
taxable items [ = ]
nontaxable items [ M+ ]

After finishing entering all the items, add sales tax:
[ GRAND TOTAL ] [ × ] sales tax rate [ % ] [ = ]

Calculate the total invoice:
[ MR ] [ = ] [ GRAND TOTAL ]

The example will use Method 1.

An Example of an Invoice

Taxable Items:
$ 19.99
$ 39.96
$ 14.97

Nontaxable Items:  
$ 109.00
$  15.00

Sales Tax Rate:  9% 

As long as you keep your designation of what memory registers are used, you can enter each item in any order.  So both methods should work.

[ AC/ON ] [ MC ]
109 [ = ]
15 [ = ]
19.99 [ M+ ] 
39.96 [ M+ ]
14.97 [ M+ ]
[ MR ] [ × ] 9 [ % ] [ M+ ] 
[ MR ] [ = ] 
[ GRAND TOTAL ]

Result:  205.6628

[ AC/ON ] [ MC ]
109 [ = ]
19.99 [ M+ ] 
15 [ = ]
39.96 [ M+ ]
14.97 [ M+ ]
[ MR ] [ × ] 9 [ % ] [ M+ ] 
[ MR ] [ = ] 
[ GRAND TOTAL ]

Result:  205.6628

Invoice:  $205.66

The calculators I used for this example are the Casio JF-100BM and Casio MC-12M Shop Calculator.  

Eddie

All original content copyright, © 2011-2020.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 

Saturday, October 19, 2019

HP 12C: Total Sales Tax with Rounded Amounts

HP 12C:  Total Sales Tax with Rounded Amounts




Introduction

The following program calculates the total invoice with the total sales tax.   Each time sales tax is calculated, the amount is rounded to two decimal places.

For example:

What is the total invoice for the purchase of three taxable items, if the sales tax is 9.5%. 

$19.95
$32.85
$47.50

The calculation:

19.95 + round(19.95 * .095,2)
+ 32.85 + round(32.85 * .095,2)
+ 47.50 + round(47.50 * .095,2)


= 19.95 + 1.90
+ 32.85 + 3.12
+ 47.50 + 4.51

= 109.83

Rounding to 2 Decimal Places 

The FIX 2 mode rounds results to 2 decimal places, but for the purposes the display only.  The number retains it's full decimal expansion.

When you want to use the rounded amount, we can use the following routine:

In fixed 2 mode:  [ f ] 2

...
1
EEX
2
*
ENTER   // makes a duplicate of the number
FRAC   // takes the fraction
.
5
x<>y   
x≤y   // is the fraction part less than 0.5
GTO  (A)   // go to line where (A) is

R↓  // fraction part is more than 0.5
+
GTO (B)

R↓   // (A)
R↓

ITNG  // (B), finalize the rounded number
1
EE
2
÷    // rounded number in the stack
...

Example:  425/118 = 3.60 in the display, shows 3601694915 when pressing [ f ] (PREFIX)

After this routine, we have 3.60, shows 3600000000 when pressing [ f ] (PREFIX)

Instructions:
1.  Enter the tax rate.
2.  Press [ f ] (PRGM), [R/S]
3.  Enter the item's cost, press [R/S]
4.  For subsequent items, enter the cost, then [R/S]
5.  When finished, press [RCL], 1 to recall total rounded sales tax.  Press [RCL], 2 to recall the total invoice.

I have program set to pause to show the rounded sales tax when each cost is entered. 

Program:
(Step ##: key code, key)
01:  44,0  STO 0
02:  42, 2  FIX 2
03:  35,  CLx
04:  44, 1 STO 1
05:  44, 2 STO 2
06:  31  R/S
07:  45, 0  RCL 0
08:  25   %
09:  1     1
10:  26   EE
11:  2     2
12:  20   *
13:  36   ENTER
14:  43, 24  FRAC
15:  48    .  (decimal point)
16:  5      5
17:  34   x<>y
18:  43, 34  x≤y
19:  43, 33, 23  GTO 23
20:  33   R↓
21:  40   +
22:  43, 33, 25   GTO 25
23:  33  R↓
24:  33  R↓
25:  43, 25  ITNG
26:  1    1
27:  26  EEX
28:  2     2
29:  10   ÷
30:  43, 31   PSE
31:  44, 40, 1   STO+ 1
32:  40   +
33:  44, 40, 2   STO+ 2
34:  31   R/S
35:  43, 33, 07  GTO 07

Example:
Sales Tax Rate:  9.5%
Item Costs:  $14.35, $18.99, $39.99, $23.64

Keystrokes:
9.5  [ f ] (PRGM) [R/S]
14.35 [R/S]
18.99 [R/S]
39.99 [R/S]
23.64 [R/S]

R1:  Total rounded sales tax:  9.21
R2:  Total invoice:  106.18

Eddie

All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Monday, April 29, 2019

Four Function and Desktop Calculators: The [ TAX+ ] and [ TAX- ] Keys

Four Function and Desktop Calculators: The [ TAX+ ] and [ TAX- ] Keys

A good subject for a Monday (start off the work week for most of us, me included)

The TAX+ and TAX- keys up close and personal  (Casio SL-300VC)


What is needed:  a calculator with [ TAX+ ] and [ TAX- ]

Introduction

On a four function or desktop calculator with the [ TAX+ ] and [ TAX- ] keys, you can perform tax calculations and financial calculations.  The primary key purpose of these keys is for sales tax.  The procedure for these calculations are (almost) universal.  However, the procedure to set such tax varies by manufacturer.

Casio:  Hold [AC] until the display blanks and refreshes.  Enter the tax rate and press [ % ] (RATE SET). 

Texas Instruments (TI-1795SV):   Enter the tax rate, press [ rate ], [ tax+ ] (store)

Canon:  Press [AC], [ TAX+ ] (SET), enter the rate, and press [ TAX+ ]

Sharp: Press [ CE/C ], [ CE/C ] (twice), [ TAX+ ], enter the rate, press [ TAX+ ]

Printing Calculators (various):  Set tax setting switch to SET, enter the rate, set the tax setting switch back to calculator mode.  Check your manual because printing calculators may vary.

My focus will be on four function and desktop calculators.  Procedures for printing calculators will probably vary.

Note:  I did the procedures listed in today's blog entry on both the Casio SL-300VC and Casio LS-123K.  For using independent memory, check to see if you have either a combined memory recall/clear key [MRC] (or [RM/CM on the LS-123K) or two separate keys ([MR] for recall and [MC] for clear).  For illustration purposes I will use [MRC]  (once for recall, twice for clear).   Remember that you can press [AC] to clear memory. 

Left:  Canon LS-123K (Green), Right:  Casio SL-300VC (Blue)


Note:  Pressing [AC] or [MRC] [MRC] will only clear the memory register, not the tax rate.

Contents

1.  Testing What Tax Rate is Stored in Memory
2. Price After Sales Tax and the Amount of Tax
3. Adding Taxable and Non-taxable Amounts
4. Calculating Use Tax
5.  Find the Taxable Amount Given the Grand Total (Total Plus Tax)
6.  Finance: Using [ TAX+ ] to calculate Future Value
7.  Finance: Using [ TAX- ] to calculate Present Value

For all the examples today, I have the tax rate set to 9.5%.  Please see the Introduction section above on how to set the tax rate.

1.  Testing What Tax Rate is Stored in Memory

This procedure is for any calculator that does not have a recall tax feature, although it works for these calculators too.

Procedure:

100 [ TAX+ ] [ - ] 100 [ = ]

Example:  (remember I'm using the tax rate set at 9.5% for all examples on this blog entry)

100 [ TAX+ ] [ - ] 100 [ = ]
Result:  9.5

2. Price After Sales Tax and the Amount of Tax

The [ TAX+ ] key performs two operations:

Press [ TAX+ ] once to calculate the total plus tax
Press [ TAX+ ] again to calculate the tax amount

Example:

An invoice shows of a purchase of equipment totaling $250.00.  Find the total after tax and the sales tax.

250 [ TAX+ ]
Display:  273.75   (total invoice:  $273.75)

[ TAX+ ]
Display:  23.75   (sales tax:  $23.75)


3. Adding Taxable and Non-taxable Amounts

Sometimes an invoice has both taxable amount and non-taxable amounts (such as most services, installation fee, sometimes freight, some food).  We can calculate the total invoice accurately with both the TAX and memory keys.  Start by clearing out the memory. 

Procedure:

[MRC] [MRC] taxable amount [ TAX+ ] [ M+ ] n
non-taxable amount [ M+ ] 
[MRC]  (recall memory)

Example:

Suppose has the invoice has:

A scanner that subject to sales tax:  $69.99
Computer services not subject to sales tax: $34.95
Sales Tax Rate:  9.5%

[ MRC ] [ MRC ] 69.99 [ TAX+ ] [ M+ ] 34.95 [ M+ ] [MRC]

The total invoice is $111.59   (8-Digit display shows 111.58905)


4. Calculating Use Tax

In certain states, such as California, use tax on a purchase can occur.  Where you take delivery determines what sales tax rate you would pay.  If a vendor does not charge the required tax, the use tax kicks in, which constitutes the remaining amount required from the buyer.  How to pay the use tax is beyond the scope of this blog entry. 

Procedure:

taxable amount [ TAX+ ] [ TAX+ ] [ - ] sales tax charged [ = ]

Example:

A purchase of a printer from an online store has a retail price of $164.79.  Sales tax of 8% was charged on the printer in the amount of $13.18.  The purchaser lives in a tax district that has a sales tax rate of 9.5%.  What is the use tax?

164.79 [ TAX+ ] [ TAX+ ] [ - ] 13.18 [ = ]  

The use tax is $2.48  (8-Digit display shows 2.47505)


5.  Find the Taxable Amount Given the Grand Total (Total Plus Tax) 

Sometime you know only the grand total of the invoice, but you need to find what was the taxable amount and the tax applied to that amount.  That is what the key [ TAX- ] is for.

Press [ TAX- ] once to calculate the taxable amount
Press [ TAX- ] again to calculate the tax amount

This is the inverse of the [ TAX+ ] key.

Example:

During an audit, we find an invoice from an electronics retail store for a purchase of a video projector.  However, only the total invoice is readable, in the amount of $187.44.  What is the retail price and what was the sales tax charged?

187.44 [ TAX- ]
Display:  171.17809   (taxable amount:  $171.18)

[ TAX- ]
Display:  16.261917 (sales tax:  $16.26)


6.  Finance: Using [ TAX+ ] to calculate Future Value

Time for a little unorthodox use of the TAX keys to calculate simple compound interest problems.  If you have an investment and you want to know how much your account will be in n periods (usually year), you can use the [ TAX+ ] [ = ] combination.

FV = PV * (1 + r%)^n

FV = future value
PV = present value
r% = interest rate, stored as the TAX rate
n = number of periods

Procedure:

[ MRC ] [ MRC ] 
present value [ M- ]
Loop:  [ TAX+ ] [ = ]   (do this n times for n periods)
(display future value)
[ M+ ] [ MRC ] 
(display interest earned)

Example:

You deposit $1,000.00 in a moderate to aggressive investment account that pays an average of 9.5% per year.  What is the balance after 5 years?  How much interest is earned in those five years?

[ MRC] [ MRC ] 
1000 [ M- ]
[ TAX+ ] [ = ]
[ TAX+ ] [ = ]
[ TAX+ ] [ = ]
[ TAX+ ] [ = ]
[ TAX+ ] [ = ]    (loop the last two keys 5 times)
Future value:  $1,574.24  (8-Digit display: 1574.2385)

[ M+ ] [ MRC ]
Interest earned:  $574.24  (8-Digit display:  574.2385)


7.  Finance: Using [ TAX- ] to calculate Present Value

Similarly, we can use the [ TAX- ] [ = ] combination to calculate the present value of a discounted note. 

PV = FV / (1 + r%)^n

FV = future value
PV = present value
r% = interest rate, stored as the TAX rate
n = number of periods

Procedure:

[ MRC ] [ MRC ] 
future value [ M+ ]
Loop:  [ TAX- ] [ = ]   (do this n times for n periods)
(display future value)
[ M- ] [ MRC ] 
(display interest earned)

Example:

You want to save $10,000.00 in five years.  You find an account that pays 9.5% annual interest.  How much will you need to deposit today to get that $10,000.00 goal in five years?

[ MRC] [ MRC ] 
10000 [ M+ ]
[ TAX- ] [ = ]
[ TAX- ] [ = ]
[ TAX- ] [ = ]
[ TAX- ] [ = ]
[ TAX- ] [ = ]    (loop the last two keys 5 times)
Present value:  $6,352.28  (8-Digit display: 6352.2775)

[ M- ] [ MRC ]
Interest earned:  $3,647.72  (8-Digit display:  3647.723)

What the [ TAX+ ] and [ TAX- ] Keys Calculate

With the tax rate r set:

[ TAX+ ] calculates:   number in the display * ( 1 + r/100)

[ TAX- ] calculates:  number in the display / (1 + r/100 )

Happy calculating and may all your calculations, and work weeks, be successful,

Eddie


All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Sunday, March 24, 2019

HP 17BII and HP 17BII+: Finance Solver Equations

HP 17BII and HP 17BII+:  Sales Tax, Substantial Presence Test, Automobile Purchase, Principal Interest Property Tax & Insurance (PITI), Retirement Accounts

Note:  Some equations have the L (Let) and G (Get) functions, which are not available on the brown keyboard of the 17BII+ (around 2003). 

Sales Tax:  Determine the total amount of taxable items and non-taxable items.

AMT=NTAX+TXBL*(1+R%÷100)

AMT:  Total Amount
NTAX:  Items not subject to sales tax
TXBL:  Items subject to sales tax
R%:  sales tax rate

Example 1:  A company purchases equipment which costs $99.99, which was subject to 9.5% sales tax, which includes $139.99 of services.  The services are not subject to sales tax.  What is the total invoice? 

Input:
NTAX:  139.99
TXBL: 99.99
R%:  9.5(%)

Output:
AMT = 249.48

The total of the invoice is $249.48.

Example 2:  During an audit, a company finds an invoice with the total of $236.40 (amount), and the invoice listed non-taxable services of $146.50.  The company lives in a county where the sales tax is 8.75%.  What is the amount of taxable items? 

Input:
NTAX:  146.50
R%:  8.75(%)
AMT:  236.40

Output:
TXBL = 82.67

The amount of taxable items on the invoice is $82.67.

Substantial Presence Test

For more information about the substantial presence test, please click here:  http://edspi31415.blogspot.com/search?q=substantial+presence+

This equation uses Let and Get. 

SPT=IF(L(X:DDAYS(D:12.31+FP(100*D)÷100:1)>183:DATE(D:183):DATE(1.01+(FP(100*D)+.0001)÷100:IP(183-G(X)÷3)))

STP:  Number of days calculated for the Substantial Presence Test
D:  Date (in the format DD.MMYYYY)

Example 1:

D:  1.052019 (1/5/2019),  SPT = 7.072019 (7/7/2019)

Example 2:

D:  6.182008 (6/18/2008), SPT = 12.182008 (12/18/2008)

Example 3:

D:  9.262018 (9/26/2018), SPT = 6.012019 (6/1/2019)

Example 4:

D:  7.102017 (7/10/2017), SPT = 5.062018 (5/6/2018)

Financing the Purchase of an Automobile

This equation deals with the purchase of an automobile. 

AUTO:PRICE*(1-DISC%*.01)*(1+STAX%*.01)-DOWN=PMT*USPV(I%÷12:YRS*12)

PRICE: Sticker price of the automobile
DISC%:  Discount percent
STAX%: Sales tax rate
DOWN:  Down payment (amount)
PMT:  Payment of the loan
I%:  Interest rate of the loan
YRS: Number of years of the loan

Example 1:  The sticker price of a car is $28,000.00.  A discount of 15% is offered.  The car is subject to 10% sales tax.  The dealer offers a 6-year loan at 4.5%.  With $2,000, what is the monthly payment?

Input: 
PRICE: 28000.00
DISC%: 15
STAX%:  10
DOWN: 2000
I%:  4.5
YRS: 6

Output:
PMT = 383.83

The monthly payment is $383.83. 

Example 2:  Assuming the same facts from Example 1, expect the buyer wants to pay no more than $350.00 a month.  What is the required down payment?

Input: 
PRICE: 28000.00
DISC%: 15
STAX%:  10
I%:  4.5
YRS: 6
PMT: 350.00

Output:
DOWN = 4131.42

The down payment needs to be $4,131.42.

Real Estate:  Principal Interest Property Tax & Insurance (PITI)

Determine the total payment of mortgage when considering property tax and property insurance. 

PITI=MORT÷USPV(I%÷12:YRS*12)+(PROP$+INS$)÷12

PITI:  Payment including principal, interest, property tax, and insurance
MORT:  Mortgage amount, price of the property
I%:  Annual interest rate
YRS: Number of the years of the mortgage
PROP$:  Annual property tax
INS$:  Annual property insurance

Example:  A buyer purchases a home with a price of $200,000.00.  The amount is to be financed.  The loan lasts for 30 years and 5% interest rate.  There is annual property tax of $1,200.00 with insurance of $395.95.  What is the buyer's PITI?

Input:
MORT: 200000.00
I%:  5
YRS: 30
PROP$:  1200.00
INS$:  395.95

Output:
PITI = 1206.64

The buyer's PITI is $1,206.64. 

Retirement Accounts:  Future Value and Earned Untaxed Dividends

Determine the future value and untaxed dividends of tax-free retirement accounts (IRS/Keogh).

There are two versions, the second uses Let (L) and Get (G) functions.

Version 1:
IRA: VAL*0+DIV*0+IF(S(VAL):USFV(I%:YRS)*PMT*(1+I%÷100)-VAL:0)+IF(S(DIV):(USFV(I%:YRS)*(1+I%÷100)-YRS)*PMT-DIV:0)

Version 2:
IRA:(VAL+DIV+L(X:USFV(i%:YRS)*(1+I%÷100)))*0+IF(S(VAL):G(X)*PMT-VAL:(G(X)-YRS)*PMT-DIV)

Input Variables:
I%:  Annual Interest Rate
YRS:  Number of Years
PMT:  Annual Payment

Output Variables:
VAL:  Tax Free Value of the Retirement Account
DIV:  Total Untaxed Dividends Earned

Remember, these are untaxed amounts.

Example:
I%:  6.88
PMT:  1000.00
YRS: 40

Output (Results):
VAL = 206811.01
DIV = 166881.01

Source:
Tony Hutchins, Luiz Vieria, and Gene Wright "HP 12C Platinum Solutions Handbook"  Hewlett Packard.  Revised 03.04  2004

Eddie

All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Tuesday, March 13, 2018

HP Prime: Car Payment and Affordability


HP Prime:  Car Payment and Affordability

Introduction

The two programs presented here tackle common financial questions of purchasing automobiles.  (or other equipment).   CARPMT calculates what would be the monthly payment, while CARAFFORD calculates the sticker price that the buyer can afford.  The variables that are considered are:

N = number of monthly payments, typically 48, 60, or 72 (for 4, 5, or 6 year term, respectively)
I = annual interest rate of the buyer can get, hopefully this rate is low
S = sales tax rate
D = discount rate, as car dealers tend to off discounts
W = down payment (enter as negative)

Firmware 13441 is used and the Finance app functions TvmPMT and TvmPV are used.  For the finance functions, they are designated with the “Finance.” prefix to allow usage of the program on any app.   TVM cash flow convention is retained, outflows (payments) are entered as negative while inflows (in this case the financing loan) are treated as positive. 

HP Prime Program CARPMT

EXPORT CARPMT(N,I,P,S,D,W)
BEGIN
// enter down pmt as negative
// 2018-03-12 EWS
// Function Setup
// no. payments,
// annual interest, price,
// sales tax, discount, down pmt

LOCAL X;
X:=P*(1+S/100)*(1-D/100)+W;
// Finance app
X:=
Finance.TvmPMT(N,I,X,0,12);

RETURN ROUND(X,2);

END;

Example: 
Term:  60 months
Interest Rate: 4.5%
Sticker Price: 18995
Sales Tax: 9.5%
Discount Rate: 10%
Down Payment: $1000

CARPMT(60,4.5,18995,9.5,10,-1000)

Result:  -330.35

Payment is $330.35

HP Prime Program CARAFFORD

EXPORT CARAFFORD(N,I,X,S,D,W)
BEGIN
// pmt and down pmt enter
// as negative
// 2018-03-12 EWS
// Function Setup
// no pmts, annual interest,
// payment (as pqsitive),
// sales tax, discount, down pmt

LOCAL P;
// Finance app
P:=
Finance.TvmPV(N,I,X,0,12);
// calculating affordable price
P:=(P-W)/((1+S/100)*(1-D/100));

RETURN ROUND(P,2);

END;

Example: 
Term:  60 months
Interest Rate: 4.8%
Payment:  $350.00
Sales Tax: 9.5%
Discount Rate: 10%
Down Payment: $500

CARAFFORD(60,4.8,-350,9.5,10,-500)

Result:  $19,418.67
The car that can be afforded is $19,418.67 (before sales tax and discounts). 

As day of this post is on Pi-Day Eve, Happy Pi Day on March 14!  Ï€ = 3.141592653…

Eddie

This blog is property of Edward Shore

Sunday, July 28, 2013

Discounts and Sales Tax: What is the Final Price?

SALE! GET THIS WONDERFUL ITEM FOR A SUBSTANTIAL DISCOUNT! GOOD FOR THIS WEEKEND ONLY!

Chances are that we have all seen this advertisement at least one time in our lives. Chances are that if you are shopping with someone, that person asks what the price is after the discount. And in a lot of instances, depending on where you live, you have to take sales tax into consideration. Today's blog is about how to find the final price after the discount and sales tax.

Note: All the examples presented here are using prices stated in dollars ($). Rest assured the concepts hold for all other units of currency. Also, all dollar amounts are rounded to two decimal places.


The Math Behind it All

Discounts

Let D be the discount. Since the discount is customarily stated as a percentage, such as "take 20% off of everything on this rack", we'll express the discount as its decimal equivalent: 0.01*D. Discounts are subtracted from the price.

For example, a item normally sold for $59.99 which has a 20% discount has a discounted price of $47.99.

$59.99 - 20%
$59.99 - $59.99 * 0.01 * 20
$59.99 * (1 - 0.20)
$59.99 * 0.80
$47.99

A general formula for subtracting D% from X is:

X - D%
X - X * 0.01 * D
X * (1 - 0.01 * D)

Sales Tax

Let S be the sales tax. Sales tax works like discounts, except that sales tax is added to the price. We'll express the sales tax as its decimal equivalent: 0.01*S.

Where I live, which is located in the County of Los Angeles in California, the sales tax is 9%. For example, if I purchase a taxable item for $59.99, taking sales tax into account, the total cost to me is $65.39.

$59.99 + 9%
$59.99 + $59.99 * 0.01 * 9
$59.99 + $5.40
$65.39

Likewise, we can use a general formula for adding S% to X is:

X + S%
X + 0.01 * S * X
X * (1 + 0.01 * S)


The Final Price of a Discounted Item After Sales Tax

Let's come up with a general formula where we determine the final price of an item which normally sells for $P (or whatever currency you work with), sold at a discount D%, which the item subject to sales tax of S%.

Customarily, the discount gets applied before the sales tax. Then the final price works out to be:

$P - D% + S%

To simplify this, start with subtracting the discount:
($P - D%) + S%
($P - $P * 0.01 * D) + S%
($P * (1 - 0.01 * D) + S%

Next, add the sales tax:
($P * (1 - 0.01 * D) + ($P * (1 - 0.01 * D)) * S * 0.01
($P * (1 - 0.01*D))(1 + 0.01*S)

So the final cost is:
$P * (1 - 0.01*D) * (1 + 0.01*S)

Taking from our example before, let's say that the item originally priced at $59.99 is discounted at 20%. What is the final cost after 9% sales tax is applied?

P = $59.99
D = 20
S = 9
And the final cost is:

$59.99 * (1 - 0.01*20) * (1 + 0.01*9) = $52.31

In the next section, we will determine a "combined rate".


Simplified Rate Considering Both Discount and Sales Tax

Here we are going to find a general formula for a "combined rate", or a rate that takes both the discount and sales tax rate into account.

Basically, the "combined rate" is what the final price would be if the original price was $1.00. ($P = $1.00)

The combined rate is (1 - 0.01D)*(1+0.01S)

In our example the combined rate for an item discounted 20%, subject to sales tax of 9% is 0.872. (87.2%)

(1 - 0.01*20)(1 + 0.01*9)
0.872

Under these conditions, you should expect to pay 87.2% of the original price when it is all said and done. For an item with an original price of $59.99, the final cost is:

Price * Combined Rate
$59.99 * 0.872
$52.31

Another example: item has an original price of $18.99. The discount is 10% while the sales tax rate is 9%

Combined rate:
(1 - 0.10 * 10) * (1 + 0.01 * 9)
0.981

Final cost:
$18.99 * 0.981
$18.63

As a check, let's find the final cost if we applied the discount then sales tax step by step.
($18.99 - 10%) + 9%
($18.99 - $18.99 * 0.01 * 10) + 9%
$17.09 + 9%
$17.09 + $17.09 * 0.01 * 9
$18.63

It checks out.

This is a quick table of combined rates using various sales tax and discount rates. The iOS App Numbers is used to generate this table.

Example: What is the final cost for at item originally priced $69.95 that is discounted 35%. The sales tax rate is 10%.

From the table above, the combined rate is 0.715. The final cost is $69.95 * 0.715 = $50.01.


I hope you find this helpful, and as always I appreciate your comments.

I want to do another mathematical series. I plan to do a short series of ordinary differential equations within the next couple of months, but if there is anything you suggest, subjects, calculators, calculator programming languages, please do. Many thanks as always.

My next blog entry will be within a couple of weeks. I am taking care of family and also going on a short vacation next weekend - hopefully the weather at Landers, CA will be nice as I go on my first astronomical star party.

Eddie



This blog is property of Edward Shore. 2013

DM42 and HP 42S: Quadratic Equation, Characteristic Polynomial, and Eigenvalues

DM42 and HP 42S: Quadratic Equation, Characteristic Polynomial, and Eigenvalues The programs are listed for the Swiss Micros DM42 an...