Friday, April 6, 2018

HP 12C and HP Prime: Combo Loans


HP 12C and HP Prime: Combo Loans

Introduction

Home buyers with good credit are sometimes offered a combo loan, also known as a “Piggyback” loan, as a financing option in purchasing the house.  When more than the amount of a purchase of a home is above 80% of the purchase price, private mortgage insurance (PMI) is required.  In order to save money, combo loans split the price into multiple loans.  Common types include:

80:20:  Two loans, one for 80% of the price (large), 20% of the price (small)

80:15:5:  Two loans, one for 80% of the price (large), 15% of the price (small), with 5% of the price as a down payment

80:10:10:  Two loans, one for 80% of the price (large), 10% of the price (small), with 10% of the price as a down payment

Each loans have separate terms (number of years and interest rate).  Monthly end-of-period payments are assumed.

HP Prime Program COMBOLOAN

The program COMBOLOAN calculates the payments for both separate loans and combined loans.  This particular loan covers of three types:  80:20, 80:15:5, and 80:10:10.

EXPORT COMBOLOAN()
BEGIN
// EWS 2018-04-05
// Piggyback Loan
LOCAL a,lst,k;
LOCAL t1,t2,i1,i2;
LOCAL d,p1,p2,p;
// terms, order allows to
// use eqn −5*k+25
lst:={"80:20","80:15:5","80:10:10"};
// input
INPUT({a,t1,i1,t2,i2,{k,lst}},
"Payment: Combo Loan",
{"Loan: ","Term1:","Rate1:",
"Term2:","Rate2:","Type :"},
{"","years","","years","",""});
// calculation
p1:=Finance.TvmPMT(t1*12,i1,a*0.8,0,12);
p2:=Finance.TvmPMT(t2*12,i2,a*(−0.05*k+0.25),0,12);
p:=p1+p2;
// down payment
d:=−a*0.05*(k-1);
// payment: down, total,
// large, small
RETURN {d,p,p1,p2};
END;

Output:  {down payment, total payment, large payment, small payment}

Examples:

Loan Amount:  $200,000.00
80% Loan: Term:  30 years, Rate: 4.5%
Small Loan: Term: 15 years, Rate 5%

Example 1:  Type 80:20

Result:  {0, -1,127.01, -810.70, -316.32}

Example 2:  Type 80:15:5

Result: {-10,000.00, -1047.93, -810.70, -237.24}

Example 3:  Type 80:10:10

Result:  {-20,000.00, -968.86, -810.70, -158.16}

HP 12C Platinum Program: 80:10:10 Combo Loan

Inputs:

Store Loan Amount in R1
Large Loan (80%):  Number of Years in R2, Annual Interest Rate in R3
Small Loan (10%):  Number of Years in R4, Annual Interest Rate in R5

Output:

Large Loan Payment, Small Loan Payment, Combined Payment (R6)

STEP
CODE
KEY
NOTES
001
42, 34
Clear FIN

002
45, 1
RCL 1

003
8
8

004
0
0

005
25
%

006
13
PV

007
45, 3
RCL 3

008
43, 12
[ g ] [ i ] (12÷)
Store monthly interest rate
009
45, 2
RCL 2

010
43, 11
[ g ] [ n ] (12x)
Store monthly payments
011
14
PMT
Calculate payment of 80% loan
012
44, 6
STO 6

013
31
R/S

014
45, 1
RCL 1

015
1
1

016
0
0

017
25
%

018
13
ENTER

019
45, 5
RCL 5

020
43, 12
[ g ] [ i ] (12÷)

021
45, 4
RCL 4

022
43, 11
[ g ] [ n ] (12x)

023
14
PMT
Calculate payment on the 10% loan
024
31
R/S

025
45, 6
RCL 6

026
40
+

027
44, 6
STO 6

028
43, 33, 000
GTO 000
On the regular HP 12C, the line is GTO 00

Example:

Terms: 80:10:10

Loan Amount:  $200,000.00
80% Loan: Term:  30 years, Rate: 4.5%
10% Loan: Term: 15 years, Rate 5%

Results:
-810.70  (payment of 80% loan)
-158.16  (payment of 10% loan)
-968.86  (payment of combined loan)

Sources

Calculated Industries Real Estate Master IIIX: Resident Real Estate Finance Calculator Pocket Reference Guide  Calculated Industries, LLC.: Carson City, NV 2010

Mortgage-Info.com  “Piggy Back Mortgage Calculator” Mortgage Info.com 2011 http://www.mortgage-info.com/mortgage-calculators/piggybackmortgagecalculator.aspx  Accessed April 4, 2018.


Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Wednesday, April 4, 2018

HP Prime Programming Tutorial is now available


HP Prime Programming Tutorial is now available

The HP Prime Programming tutorial is a set of twelve tutorials designed to get up and running on HP’s PPL programming language.  Knowledge of the programming language will help you take your HP Prime further.  The topics covered are:

1.  Help Key, Local Variables, RETURN command
2.  Message box, IF-THEN-ELSE structure, FOR loop
3.  WHILE loop, REPEAT loop, Detecting key presses
4.  CHOOSE command (providing a pop-up menu), CASE structure
5.  Colors, Switching Apps
6.  Subroutines
7.  Drawing Graphics, Cartesian vs Pixel Coordinates
8.  Drawing Lines, Polygons, Arcs, Circles
9. Numerical Calculus
10. Using App Functions in Programs
11. Drawing and using a soft menu
12. Creating custom apps

Firmware Version 13441



A little history

If you want to look at my original tutorial series that posted during October through December 2013, the first of the series is here: https://edspi31415.blogspot.com/2013/10/hp-prime-programming-tutorial-1-local.html 

However, the HP Prime’s firmware had a lot of updates since then.  And the PDF file has more topics and is up to date. 

On the date of this entry, this blog is one week away from its 7th Anniversary.  This blog’s “birthday” is April 11.  I want to thank you all for your support and compliments, this is labor of love for. 

Enjoy!

Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Friday, March 30, 2018

Retro Review: Texas Instruments TI-54

Retro Review:  Texas Instruments TI-54



General Information

Company:  Texas Instruments
Type:  Scientific
Memory:  7 memory registers
Battery:  2 x LR-44 or 2 x AR-76
Years:  1981 - 1983
Original Cost: $40
Operating System: AOS, Immediate Execution
Storage Arithmetic:  +, -, *, ÷, ^, roots, percent change

It’s good to finally to get the calculator that accompanies the Scientific Calculator Sourcebook that I bought years ago. 

Features

The TI-54 is a scientific calculator with a lot of additional features over the typical non-programming scientific calculator that was released at the time. 

Percent Key (Δ%) 

I think the percent works backwards than modern calculators.   Press the new value first, then [2nd] ( Δ% ), then old value, [ = ].

Example:  Percent change from 32 to 56:  56 [2nd]  (Δ%) 32 [ = ] 75  (75% increase)

Combinations and Permutations

Like the TI-55 III, the arguments for combination and permutation functions take one argument in the form of nnn.rrr.  

Example:

Combination where n = 25, r = 5 is entered as 25.005 [2nd] [ 9 ] (nCr)  
(Result: 53,130)

Permutation where n = 25, r = 5 is entered as 25.005 [2nd] [ 8 ] (nPr)  
(Result:  6,375,600)

Rectangular/Polar Conversion

[2nd] [x<>y] (P-R):  to Rectangular.  Input:  r [x<>y] θ [2nd] [x<>y] (P-R).  Result: y [x<>y] x.

[INV] [2nd] [x<>y] (P-R):  to Polar.   Input x [x<>y] y [INV] [2nd] [x<>y] (P-R).  Result:  θ [x<>y] r.

Statistics

The TI-54 has one variable and two variable statistics, with linear regression of the equation y = a * x + b.   The b/a key gives the intercept and slope.  Predictive values and correlation are also available.

Extra Functions

The TI-54 also has percent change, absolute value, fractional part, and integer part. 

Other Functions

Other functions include degree/degree-minutes-seconds conversions and constant operations with [ K ].

Complex Numbers

Perhaps the biggest attraction of the TI-54 is the complex number mode.  Complex mode is activated as soon as the complex number is entered.

To enter complex numbers:

Rectangular:  b [ Img ] a

Polar:  θ [ θ ] r

Since the display is one number, the real part/magnitude is default shown.  To show the complex part, press [ EXC ] [ Img ]/[ θ ] to show the imaginary part/angle.  The user will know if that the imaginary part/angle is shown by the CMPLX indicator is flashing.

The amount of functions to complex functions offered are greater than most scientific calculators would offer, which is impressive at the time:  arithmetic, power, natural logarithms, exponentials, square root, and square.

Keyboard

Scientific calculators that were produced from Texas Instruments in that era (early 1980s) had a reputation for their not so great keyboards, affecting TI-54, TI-55 II, and TI-57.  Unfortunately, the keyboard is the Achilles’ Heel for this model.  On occasion, pressing the key doesn’t register, and occasion the key registers twice.  This problem is prevalent on the number keys.   So operating the TI-54 will require patience and maybe a few extra presses of the [ON/C] key.  Other than this, the TI-54 worked well. 

Verdict

If you are to purchase a TI-54, please be aware of possible keyboard issues, other than that it is a good calculator.

Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions

Scientific Calculators Two Ways of Entering Complex Numbers


Scientific Calculators Two Ways of Entering Complex Numbers

On scientific calculators, there are two primary ways complex numbers are entered:

1. Using the [ a ] and [ b ] keys 

2. Using a + bi notation

Complex Numbers using the [ a ] and [ b ] Keys

Calculators:  Canon F-605, Sharp EL-501X, Texas Instruments TI-35 Plus, Texas Instruments TI-52, most bargain Dollar Store calculators

This applies to most basic level scientific calculators.  Only arithmetic operations and polar/rectangular conversions apply in this mode.

Entering complex numbers:   real part [ a ] imaginary part [ b ]

Entering polar complex numbers (for conversion to rectangular complex numbers only):  magnitude [ a ] argument/angle [ b ]

Please be aware that in this mode where the [ a ] and [ b ] keys have to be used, the order of operations are not followed.

Example:  (3 + 3i) + (2 + 3i) * (4 + 3i)
(What is really calculated:  ((3 + 3i) + (2 + 3i)) * (4 + 3i))

Key Strokes: (in complex mode)
3 [ a ] 3 [ b ] [ + ] 2 [ a ] 3 [ b ] [ × ] 4 [ a ] 3 [ b ] [ = ]

Result:  2 + 39i (2 is stored in a, 39 is stored in b)

Example:  Transform 8 – 3i to Polar representation, use degrees mode

Key Strokes: (in complex mode)
Press [ DRG ] until the calculator is in Degrees mode (DEG indicator)
8 [ a ] 3 [ +/- ] [ b ] [ 2nd/SHIFT/INV ] (R→P, →rθ)

Result: 
([ a ]) 8.544003745  ( r )
[ b ] -20.55604522 ( θ )

Complex Numbers using the a + bi Notation

Calculators:  most multi-line scientific calculators (Casio fx-115ES, fx-991ES, fx-991 Classwiz, Texas Instruments TI-36X Pro, Sharp EL-W516, Canon F-792SGA, most graphing calculators  

Complex numbers using a + bi notation are entered exactly as they are written.  This mode is present on more advanced scientific calculators, particular the multiline calculators, as well as all graphing calculators.   The ability to calculate and display complex numbers may be turned on in a separate mode, or turned on through a set up menu.

Typically the available functions for complex numbers are:

* Arithmetic
* Inverse
* Square
* Polar/Rectangular Conversion
* Absolute Value
* Argument
* Real and Imaginary Parts
* Conjugate
* Square Roots (graphing calculators, all HP calculators with complex numbers)
* Exponentials and Logarithms (graphing calculators, all HP calculators with complex numbers)
* Powers, both real and complex (graphing calculators, all HP calculators with complex numbers)
* Trigonometric functions (TI-85, TI-86, TI-89, Casio Classpad, all HP calculators with  complex numbers)

In this complex numbers mode, the order of operations is followed.

Example:  (3 + 3i) + (2 + 3i) * (4 + 3i)

Key Strokes:  (*key strokes may vary)
[ ( ] 3 [ + ] 3 [ i ] [ ) ] [ + ] [ ( ] 2 [ + ] 3 [ i ] [ ) ] [ × ] [ ( ] 4 [ + ] 3 [ i ] [ ) ]

Result:  2 + 21i (2 [ Re<>Im ] 21)

Example:  Transform 8 – 3i to Polar representation, use degrees mode

Key Strokes: (in complex mode)
Press [ DRG ] until the calculator is in Degrees mode (DEG indicator)


Alternative 1:  (8 – 3i) >r∠θ,  (8 – 3i)>Polar

Alternative 2:
r:  abs(8 – 3i)
θ: angle(8 – 3i), arg(8 – 3i)

Result:
8.54003745 ∠ -20.5604522,  8.54003745*e^(-20.5604522*i)

That is two primary ways how complex numbers are entered on scientific calculators.

Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Monday, March 26, 2018

HP Prime: Length of a Loan with a Certain Payment


HP Prime:  Length of a Loan with a Certain Payment

Introduction

The program PMTLENGTH will calculate how many payments that are required to finish a loan, given a certain annual interest rate and payment.  Payments are assumed to be monthly, and end of period.  The program will also return the last payment.  Due to the rounding in the financial algorithms, the last payment is an approximate (unless the interest rate is 0%).

Input:  PMTLENGTH(I,P,X)
I = annual interest rate
P = loan amount
X = payment amount, enter as a negative amount

Firmware 13441 or later is required.


HP Prime Program PMTLENGTH

EXPORT PMTLENGTH(I,P,X)
BEGIN
// I%YR, PV, PMT (as negative)
// 2018-03-19 EWS
// how many monthly payments?
// last payment? (FV)

LOCAL N,B;

N:=Finance.TvmNbPmt(I,P,X,0,12);
B:=P;
IF FP(N)≠0 THEN
B:=Finance.TvmFV(IP(N),I,P,X,12);
N:=IP(N)+1;
END;

// {N, final pmt}
RETURN {N,B};
END;

Examples

Example 1:  How long will I take to pay off a $2,000 loan if I make $600 payments each month?  This is a no interest loan.

Result:  {4, -200}

It will take 4 payments, with the last payment being $200.

Example 2:  How long will I take to pay off a $5,350 loan if I make $750 monthly payments each month?  The loan has a 10% monthly interest rate.

Result:  {8, -286.906502677}

It will take 8 payments, with the last payment being about $286.91.

Eddie

This blog is property of Edward Shore, 2018.

Saturday, March 24, 2018

Favorite Solar Calculators – Six Years Later


Favorite Solar Calculators – Six Years Later

Favorite Solar Calculators – Reading that Blog Entry Today

On June 10, 2012, I listed some of my favorite solar calculators of all time: 

I still love the TI-25X Solar, I wish the screens weren’t so damn fragile!  I went through two of them. 

I have two fx-115 ES Plus calculators, one gray and one black.  The black looks much better!

Maybe one day I’ll get the BA 35 Solar again from eBay.  Maybe I will give the Casio FC-200V a second shot. 

As of March 2018, Casio fx-3650pII is the current edition of the fx-3650P.  The fx-3650PII is in the shape of the fx-115ES/991ES/300ES/82ES Plus.  That’s about it from what I can get from research:  still four program areas with 360 steps and 7 variables.


No, Casio still currently sells the fx-3650PII only outside the United States, which means for us Americans, we have to order online.  An open invite to Casio to stock the office stores and university stores with this model in the States is extended. 

The current Sharp EL-W516 edition, the EL-516WT, eliminated the formula storage, eliminated the catalog, and reduced the definable keys from 4 to 3, I am not happy about that.




Three More Inductees

I have three more to add to the list I posted in 2012:




Casio fx-991EX Classwiz – 2015 – Present

The Classwiz model is the next step in Casio solar powered calculators.  They have an icon menu, like their graphing calculators, and there is an [OPTN] key that allows users to specific mode-specific functions.  Modes includes computation (COMP), complex numbers (arithmetic, polar/rectangular conversions), base integers, matrices up to 4 x 4, vectors, statistics, distributions, basic spreadsheets up to 5 x 45, equation solving, inequalities and ratios.  The newest feature is the QR function that will take a screen shot of the calculator, or in some cases, statistical graphs, which can be retrieved from the Casio QR Website or app.


I can only hope the next iteration the Classwiz and the fx-3650P or fx-50FII merge so programming will be included.



TI-30 SLR+ – 1987 – 1990s

This is a bigger version of the TI-25X Solar (TI-30X Solar internationality).  This calculator completely runs on solar and light power.  What I look about this better than the TI-25X are the keys and the fact the display isn’t so fragile.  See my detailed blog of it here:  https://edspi31415.blogspot.com/2014/09/ti-30-slr-and-memories-of-school.html




Casio fx-260 Solar II (we can included the Casio fx-260 Solar, fx-82 Solar, fx- 82 Solar II)
Original fx-260 Solar/fx-82 Solar:  2000s – present
Current fx-260 Solar II/fx-82 Solar II: 2017 – present

I don’t know what I was thinking when I skipped this model last time.  The fx-260 offers a wide variety of functions:  trigonometry, logarithms, fractions, degrees and degrees-minute-second conversions, polar/rectangular conversions, and one variable statistics.  This is great calculator for those who want a small, compact, calculator that attacks the basics.  The fx-260 series is completely solar powered.  Pictured is the newer fx-260 Solar II, which the mode markers have been mode to the back of the calculator case.  Can’t beat the classics. 



Eddie

This blog is property of Edward Shore, 2018.

Monday, March 19, 2018

Review: Canon F-605 Scientific Calculator


Review:  Canon F-605 Scientific Calculator

Company:  Canon
Type:  Scientific
Memory:  7 registers
Battery:  LR54 x 1
Years:  Current (4/172015-)
Cost: around $10
Number of Functions: 154
Operating System:  Immediate Execution



On a trip to Fry’s for computer headphone/microphone set, I always head to the aisle where the calculators are.  Besides the “dollar store calculators” and printing calculators, every one Fry’s had I have their model.  Except for the F-605, which was packaged in a box.  So to the check stands I went, with the F-605, a $2 A+ Homework scientific calculator, and headphone set in tow.

Another Clone of the Sharp EL-501X… or is it?

At first glance, the Canon F-605 looks like a clone of the Sharp EL-501X.  Sure, it has it’s complex numbers, complete with the [ a ] and [ b ] keys, the keyboard is nice and compact, and it has its base conversions with one variable statistics.  Close inspection, the F-605 differs from the EL-501X in a number of ways.

By the way, I reviewed the Sharp EL-501X in July 2014, which you can click here to see:  http://edspi31415.blogspot.com/2014/07/sharp-el-501x-today-vs-ti-35-plus-1989.html

Features

The display has 10 digits, but carries 14 internal digits. 

We have our scientific functions, logarithmic functions, exponential functions, hyperbolic functions, decimal degrees/degrees-minutes-seconds conversions and power and root.  The [ F←→S ] converts the display from floating to scientific notation.

For the polar/rectangular conversions, the [ a ] and [ b ] keys are used.  [ a  ] is used for x and r, while [ b ] is used for y and θ.

Here is where the Canon F-605 starts separating itself from the rest of the clones.  The F-605 offers fractions, with fraction/decimal conversions and improper/proper fraction form conversions. 

The F-605 has a random number function which generates numbers from 0 to 1, which has three digits. 

One of the great surprises the F-605 has is that it has seven memory registers, A through F, and M.  There are also the arithmetic storage functions M+ and M-.  The nice thing is that all seven memory registers are available on all the modes, except for statistics, where M is not available.

Base Display Modes (except for Decimal) is limited to arithmetic. To convert numbers, just call their respective mode. There are still no Boolean functions, just arithmetic. 

The Complex number mode only allows for complex number arithmetic.  The [ a ] and [ b ] are keys to enter and display the real and imaginary parts.  You still can use rectangular/polar conversions.  ( [ a ]:  real/abs, [ b ]: imaginary/argument)

The F-605 has one variable statistics.  In addition to mean, deviation, and sums, the F-605 offers the minimum and maximum of the data set.  In statistic mode, parenthesis and store to M keys are used for accessing statistical results.  You can’t use parenthesis in stats mode on the F-605.  One thing I am very happy about, unlike most of the scientific calculators in this family, the F-605 has it Statistics mode on a key other than ON/C!  Yes, putting a mode as the second function of the clear button is very annoying. 

Keyboard

The keyboard is very clean, and fonts are readable.  The keys do have a rubbery feel, but so far, out of the using it, I have no complaints about the response.  The calculator is very light weight. 

Verdict

If you are looking for an inexpensive $10 (or possibly less) scientific calculator and you don’t want a solar calculator, I can recommend the F-605.  I would say that the F-605 is just above the Casio fx-260 Solar or Sharp EL-501X.

Eddie

This blog is property of Edward Shore, 2018

Saturday, March 17, 2018

HP Prime: Advanced Payments for a Lease


HP Prime:  Advanced Payments for a Lease

Introduction

The program ADVPMT calculates the monthly payment of lease several payments are paid simultaneously at the beginning of the lease.

Firmware 13441 is used.   This program uses the TmvPV function from the Finance App.  The “Finance.” suffix will allow the program to be used regardless of which app HP Prime is set to.

HP Prime Program ADVMPT

EXPORT ADVPMT(N,I,P,S,A)
BEGIN
// advance monthly payments
// 2018-03-15 EWS
// HP 17BII+
LOCAL X;
X:=(−P-S*
Finance.TvmPV(N,I,0,−1,12))/
(Finance.TvmPV(N-A,I,−1,0,12)+A);
RETURN ROUND(X,2);
END;

Example

Find the monthly payment of a 48 payment, 4.6% lease where 3 payments are required in advance.  The amount financed is $10,000 with an expected salvage value of $2,000. 

Input:  ADVPMT(48,4.6,10000,2000,3)

Result:  -263.54

Each payment will be $263.54, with the first payment being three times that amount, or $790.62.

Source: 
Hewlett Packard.  HP 17bII+ Financial Calculator User’s Guide  Edition 3, 2007  San Diego.

Eddie

This blog is property of Edward Shore, 2018.

Wednesday, March 14, 2018

Pi Day 2018

Happy Pi Day!  Here I am celebrating with a couple of 41s (Hewlett Packard HP 41C, Swiss Micros DM41L).

Happy Birthday Albert Einstein

RIP Stephen Hawking


Ï€ = 3.1415926535...

If you want to calculate many digits of pi, there are many ways to do this.  If you have a TI-89 or HP Prime, please check out this blog from November 2016: https://edspi31415.blogspot.com/2016/11/ti-89-and-hp-prime-approximation-digits.html

Happy Pi Day!

Eddie


This blog is property of Edward Shore, 2018


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

HP 42S/DM42/Free 42: Two Functions Programmed Three Different Ways

HP 42S/DM42/Free 42: Two Functions Programmed Three Different Ways Introduction In 1979, Electro Scientific Industries (esi)...