Thursday, July 12, 2018

Fun with the Radio Shack EC-4026



Fun with the Radio Shack EC-4026 

(Equivalent of the Casio fx-4500P)

Programming Notes

 


The syntax for prompting for variables and displaying results are slightly different from the usual Casio programming language (as I mentioned, the EC-4026 is a clone of the fx-4500P).  Check out the unusual If-Then-Else-End structure as well. 

Prompting Syntax:
{var} : var “prompt string”

Example:
 {X}: X”ENTER X”

Display Syntax:
Calculation
“Display string”   (solid right triangle, [2ndF] [↑])

Example: 
X
“F(X)=”

The If-Then-Else-End Structure:
If condition do if the condition is true do if condition is false   (clear right triangle, [2ndF] [√])

Note:  I symbolize the [x^y] by ^.

Finding the Monthly Payment of a Mortgage with Total Interest Paid and Total Cash Outflow

Program MORTGAGE:

L1  Fix 2
L2 {A}: A”LOAN AMOUNT”
L3 {Y}: Y”YEARS”
L4 {I}: I”RATE”
L5 I = I/1200
L6 N = Y*12
L7 P = A*(I(1+I)^N)/((1+I)^N-1)
L8 “MONTHLY PMT”
L9 N*P
L10 “OUTFLOW”
L11 N*P-A
L12 “TOTAL INTEREST”
L13 Norm

Example:

A:  Loan is $250,000.00
Y:  30 years
I: Interest rate of 4%

Results:

P:  Payment:  $1,193.59
Outflow:  $429,673.77
Total Interest:  $179,673.77

Midlength, Height, and Area of a Trapezoid



Program TRAPEZIOD:

L1 {A}
L2 {B}
L3 {C}
L4 {D}
L5 H = √((-A+B+C+D)*(A-B+C+D)*(A-B+C-D)*(A-B-C+D))/(2*Abs(B-A))
L6 M = (A+B)/2
L7 K = M*H
L8 M
L9 “MIDLENGTH”
L10 H
L11 “HEIGHT”
L12 K
L13 “AREA”


Quadratic Equation A*x^2 + B*x + C = 0

Program QUAD:

L1 {A}: A”A”
L2 {B}: B”B”
L3 {C}: C”C”
L4 D = B^2-4*A*C
L5 D<0 Goto 1
L6 X = (-B + √D)/(2A)
L7 Y = (-B - √D)/(2A)
L8 Goto 0
L9 Lbl 1
L10 X = -B/(2A)
L11 “REAL”
L12 Y = √(Abs D)/(2A)
L13 “IMAG”
L14 Lbl 0
L15 “DONE”

Example:

3x^2 + 6x – 1 = 0; A = 3, B = 6, C = -1
Result:  0.154700538, -2.154700538

3x^2 + 6x + 10 = 0; A = 3, B = 6, C = 10
Result:  REAL: -1, IMAG: 1.527525232.  -1 ± 1.527525232i

Minimum Loss Matching



Variables:

Input: Y = Z0, Z = Z1

Output:

R = R1
S = R2
L = Loss Marching

Program MINLOSS:

L1 1:  “Z1<Z0”
L2 {Y}: Y”Z0”
L3 {Z}: Z”Z1”
L4 L = √(1 – Z/Y)
L5 R = Y*L: “R1”
L6 S = Z/L: “R2”
L7 L = 20 log (√(Y/Z) + √(Y/Z – 1)): “LOSS”

Example:

Input:


Y: Z0: 15
Z: Z1: 10

Output:

R1: 8.66025 Ω
R2:  17.32051 Ω
Loss:  5.71948

Add Two Polar Numbers

Polar and Rectangular conversions

Variable
Rectangular Results
Polar Results
V
x
r
W
y
θ

Program ADDPOLAR:

L1 {R}: R”R1”
L2 {S}: S”ANG1”
L3 Rec(R,S)
L4 R = V: S = W
L5 {V}: V”R2”
L6 {W}: W”ANG2”
L7 Rec(V,W)
L8 R = R+V: S = S+W
L9 Pol(R,S)
L10 V: “R SUM”
L11 W: “ANG SUM”

Example:

4 20° + 3 11 ° (In Degrees Mode)

Result (rounded to 4 digits): 6.9789 16.1442°

How to Handle a Tax Bracket (Simple Sample)

Take a sample (and simplified) tax bracket, where income is X:

0 < X ≤ 200:  tax rate is 10% of X
200 < X ≤ 600:  tax rate is 13% of X
600 < X: tax rate is 16% of X

Program:

L1 {X}: X”X”
L2 X > 600 P = 16: Goto 1
L3 X > 200 P = 13: Goto 1
L4 P = 10
L5 Lbl
L6 X * P/100


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.