Post Reply 
Casio FC-200 Financial Consultant
12-15-2020, 12:07 PM (This post was last modified: 12-15-2020 12:17 PM by Gamo.)
Post: #1
Casio FC-200 Financial Consultant
Just acquired this Casio FC-200 Financial Calculator and this calculator is programmable.

I use to program Casio Programmable calculator before long ago when I was in High School.

Since I just got this calculator so I refreshed my memony and make up two program.

I like to share this and any advice or other who got program listing to share is very welcome.

Code:

P0. Long Division

Procedure: [A for Divident] [B for Divisor]
Answer: Quotient and Remainder

Lbl 1:
?→A: ?→B:
Intg (A ÷ B)◢ 
Ans x B →C:
A-C◢  Goto 1

P1. Roll Two Dice
 
Procedure: [FIX] 1 and Input Seed to [STO] Register [Alpha] on letter [S]
Seed example: .1953767 [STO] [ALPHA] [S]

Lbl 1:
Frac (147 x S) →S:
Frac (699 x S)→R:
Intg (S x 6 + 1) + Intg (R x 6 + 1) ÷ 10 ◢ Goto 1

Gamo 12/15/2020
Find all posts by this user
Quote this message in a reply
12-16-2020, 03:21 AM
Post: #2
RE: Casio FC-200 Financial Consultant
Just noticed that this particular model it doen't have the [RAN#] function but

it got [Intg] and [Frac]

Gamo
Find all posts by this user
Quote this message in a reply
12-21-2020, 07:51 AM
Post: #3
RE: Casio FC-200 Financial Consultant
Just added the video clip to sovle for [Tax -] using
Casio FC-200 with the Tax Deduction program.

Youtube link: https://youtu.be/UiQscuKxvXw

Gamo
Find all posts by this user
Quote this message in a reply
12-21-2020, 03:01 PM
Post: #4
RE: Casio FC-200 Financial Consultant
I've got a couple of programs I use on mine. For readability, I've replaced the colons between statements with newlines. Use colons to separate statements when entering these.

Weekdays
Calculates weekdays/working days within a date range.

Use the DATE key for inputting the two dates, e.g. 12/21/2020/ (yes, you need that final slash). Date A should be the earlier date.

Code:
?→A
?→B
A-B→D
Intg(D÷7)→E
D-7E→M
5E+M→D
1/6/1901/-A
Ans-7Intg(Ans÷7)
Ans=0⇒7
Ans→W
W<7⇒W+M>5⇒D-1→D
W<8⇒W+M>6⇒D-1→D
D+1

Paydown/curtailment savings
Estimates the amount of interest saved over the remaining life of a loan if an extra principle payment of a given size is made. The financial variables should already contain the current parameters of the loan such that FV=0.

Financial variables are written in lowercase. Use RCL to insert them into formulas.

Code:
?→A
pv→P
pv-A→pv
n→N
comp n
Intg n→n
fv→F
comp fv
pmt*N-(pmt*n+fv+fv*i%÷100-A)→S
P→pv
F→fv
N→n
S
Visit this user's website Find all posts by this user
Quote this message in a reply
12-21-2020, 03:56 PM (This post was last modified: 12-22-2020 05:40 AM by Gamo.)
Post: #5
RE: Casio FC-200 Financial Consultant
Dave Thanks

The Weekday program look very interesting.

From Post #3
Little program to solve for the VAT or Exclusive Tax

Store Tax in Register Alpha [T] if tax is 8% enter 0.08 [STO] [Alpha] [T]

Enter Selling Price including Tax press [EXE] display Price Without Tax [EXE] display Tax Amount.

Program:

Lbl 1: ?→A:
A ÷ (1 + T)◢ // Answer Price without Tax
A - Ans◢ Goto 1 // Answer Tax Amount

Gamo
Find all posts by this user
Quote this message in a reply
12-24-2020, 06:02 AM
Post: #6
RE: Casio FC-200 Financial Consultant
Hello Dave

I have try your Weekdays program.

Work out ok but not on February.

I try 2/1/2021 to 2/28/2021 program run and answer 21 days

but suppost to be 20 days.

Thanks

Gamo
Find all posts by this user
Quote this message in a reply
12-24-2020, 02:25 PM
Post: #7
RE: Casio FC-200 Financial Consultant
(12-24-2020 06:02 AM)Gamo Wrote:  Hello Dave

I have try your Weekdays program.

Work out ok but not on February.

I try 2/1/2021 to 2/28/2021 program run and answer 21 days

but suppost to be 20 days.

Thanks

Gamo

Well that's interesting! At a glance, I can't figure out why it would do that. The program first calculates the actual number of days between the two dates, then calculates the number of days mod 7 since 1/6/1901 to work out the starting weekday. Must be some edge case I missed, as I don't think this has anything to do with February having fewer days. This was based on a 12C program I wrote; I'll have to see if that one has the same issue.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-25-2020, 08:16 PM
Post: #8
RE: Casio FC-200 Financial Consultant
I just ran a few test cases for dates in/around February, and I seem to be getting correct results (2/1/2021-2/28/2021 is 20, for example). I've double-checked that the program listing is accurate, so you may want to take a look for any typos in your entry. The last few lines that check W and W+M adjust for ranges that start/end on weekends, so you might want to look there first.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-26-2020, 01:14 AM (This post was last modified: 12-26-2020 01:41 AM by Gamo.)
Post: #9
RE: Casio FC-200 Financial Consultant
Thanks Dave

Just figured out what cause the wrong answer.

I didn't noticed that the calculator Date was set to 360 days mode.

Once I set to 365 the answer is now correct.

Gamo
Find all posts by this user
Quote this message in a reply
12-26-2020, 02:41 PM
Post: #10
RE: Casio FC-200 Financial Consultant
(12-26-2020 01:14 AM)Gamo Wrote:  Thanks Dave

Just figured out what cause the wrong answer.

I didn't noticed that the calculator Date was set to 360 days mode.

Once I set to 365 the answer is now correct.

Gamo

Ah, that would certainly explain it! It's probably throwing off the day-of-week calculation since the number of days since 1/6/1901 would come back different. I never use 360-day mode, so I hadn't even thought of that. Smile
Visit this user's website Find all posts by this user
Quote this message in a reply
12-26-2020, 11:31 PM (This post was last modified: 12-27-2020 05:17 AM by Albert Chan.)
Post: #11
RE: Casio FC-200 Financial Consultant
We can make the code more compact, with sign function.

PHP Code:
function sign(x) return x==and or x/abs(xend

function networkdays(AB)      -- assumed date A <= B
    local W 
A%7               -- weekday(A)
    if 
W==0 then W=1A=A+1 end -- A Sun -> Mon
    local D 
B-A
    local E 
floor(D/7)        -- weeks
    
return D-E-sign(D-7*6)    
end 

Update: the code had a bug, when A falls on Sunday.
Shifting it to Monday fixed it, matched open-office networkdays() results.
Find all posts by this user
Quote this message in a reply
12-27-2020, 12:09 AM
Post: #12
RE: Casio FC-200 Financial Consultant
(12-26-2020 11:31 PM)Albert Chan Wrote:  We can make the code more compact, with sign function.

There is definitely no sign function on an fc-200 to take advantage of that though. Wink
Visit this user's website Find all posts by this user
Quote this message in a reply
12-27-2020, 05:49 AM
Post: #13
RE: Casio FC-200 Financial Consultant
(12-26-2020 11:31 PM)Albert Chan Wrote:  return D-E-E - sign(D-7*E + W - 6)

If end date falls on Saturday, and start date not on Sunday, sign correction mess goes away.

Example, networkdays between 1/1/2021 (Friday) to 4/1/2021 (Thursday)

Remove the correction term by adjusting end-date to Saturday, 4/3/2022 Sat

D = 31 + 28 + 31 + 2 = 92 days
E = floor(D/7) = 13 weeks

networkdays (1/1/2020 to 4/3/2020) = D-E-E = 66
networkdays (1/1/2020 to 4/1/2020) = 66 - 1 = 65

PHP Code:
function networkdays(AB)      -- assumed date A <= B
    local M 
- (B-1)%7       -- days to Saturday
    local D 
B+A           -- -> Sat
    local E 
floor(D/7)
    if 
D-7*E==6 then D=D-1 end  -- A Sun -> Mon
    
if 1 then D=D-M+1 end
    
return D-E-E
end 
Find all posts by this user
Quote this message in a reply
12-27-2020, 08:49 AM (This post was last modified: 12-27-2020 10:08 AM by Csaba Tizedes.)
Post: #14
RE: Casio FC-200 Financial Consultant
(12-27-2020 12:09 AM)Dave Britten Wrote:  There is definitely no sign function on an fc-200 to take advantage of that though. Wink

On CASIOs the simplest SIGN(var) function is (var>0)-(var<0). Maybe it's works on 3650P and similar models. I have checked on my 4000P (seems same as FC models) this causes Syntax error.

Csaba
Find all posts by this user
Quote this message in a reply
12-27-2020, 02:01 PM
Post: #15
RE: Casio FC-200 Financial Consultant
(12-27-2020 08:49 AM)Csaba Tizedes Wrote:  
(12-27-2020 12:09 AM)Dave Britten Wrote:  There is definitely no sign function on an fc-200 to take advantage of that though. Wink

On CASIOs the simplest SIGN(var) function is (var>0)-(var<0). Maybe it's works on 3650P and similar models. I have checked on my 4000P (seems same as FC models) this causes Syntax error.

Csaba

Yeah, I don't think Casio changed the relational/comparison operators to work like actual mathematical functions until somewhere around the fx-9750G/cfx-9850G. Prior to that, you could only use them in conjunction with the 'if/then' arrow.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-27-2020, 04:22 PM
Post: #16
RE: Casio FC-200 Financial Consultant
Here is an implementation without sign(), and very fast.
Code:
function networkdays(A, B)  -- assumed date A <= B
    local D = B-A
    local E = floor(D/7)    -- weeks
    A = A%7                 -- weekday(A), range 0 to 6
    B = D-7*E + A           -- weekday(B), range 0 to 12
    if A>0  then A=1 end    -- default, for B<6
    if B==6 then A=A-1 end  -- Sat -> Fri
    if B>6  then A=-1 end   -- remove Sun
    return D-E-E + A
end

Sunday to Saturday is the tricky one, where my previous attempts failed.
FYI, Dave's posted code might failed this too. Please confirm.

lua> networkdays(day(2021,2,28), day(2021,3,5)) -- Sun to Fri
5
lua> networkdays(day(2021,2,28), day(2021,3,6)) -- Sun to Sat
5
lua> networkdays(day(2021,2,28), day(2021,3,7)) -- Sun to Sun
5
Find all posts by this user
Quote this message in a reply
12-31-2020, 06:05 AM (This post was last modified: 12-31-2020 11:16 AM by Gamo.)
Post: #17
RE: Casio FC-200 Financial Consultant
Just play around a bit more on this Casio FC-200 Financial Consultant calculator.

So I make a small and very handy program to use for total up a group of items price with different

discount percentage rate on each group.

This program use the Statistic Funtions to help in accumulate each items.

-----------------------------------------------

Discount Percent and Total

1. Following items is 15% discount

12.45, 55.75, 18.50, 10.25 and 75.75

Total = 172.70
Total - (15%) = 146.80
Grand Total = 146.80
-------------------------------------------
2. Following items is 20% discount

127.15, 215, 115 and 215.65

Total = 672.80
Total - (20%) = 538.24
Grand Total = 146.80 + 538.24 = 658.04
-------------------------------------------
Procedure: Fix 2
Setup:
0→M
Mode 6
------------------------------------------
Input each items to [DT] the **[MAR] button**

Select [Prog] # where you put this program

?D input Discount Percent Rate

[EXE] Items Total [EXE] Total subtract Discount [EXE] Grand Total

To input next group of items [Prog] # and same steps as above.
------------------------------------------
Program:
?→D:
T◢ Ans - D%:
Scl◢ Ans + M →M
-----------------------------------------
Remark:
The Apha Letter T in program is the [Σx] function and this function does not
show Summation on the screen in program but Shown as Letter T instead.
To put [Σx] in program enter [ALPHA] [2] and screen shown letter T
Program must activate the Statistic Mode 6 [SD] and program will automatically
clear Satistic Data on each usage so that new group of data is always ready.
-----------------------------------------
Gamo 12/31/2020
Find all posts by this user
Quote this message in a reply
05-01-2021, 01:11 PM (This post was last modified: 05-01-2021 01:14 PM by Gamo.)
Post: #18
RE: Casio FC-200 Financial Consultant
This calculator got the Pricing Calculations to find Cost, Price or Margin but no Markup.

This program will will find the Markup when the Margin is known. Even if only the Markup is

known another program will find the Margin and automatically store it.

Program #8 for convert Markup and store into the Margin

Program #9 for Convert Margin to Markup

------------------------------------------------------

Example:

Cost = 8 and Markup = 25 what is the Price?

25 [MAR] [Prog] 8 [EXE] display 20
8 [CST] [COMP] [SEL] [EXE] display answer 10

Answer: Price is 10

--------------------------------------------------

Cost = 15 and Price = 28 what is the Markup?

15 [CST] 28 [SEL] [COMP] [MAR] display 46.43
[PROG] 9 [EXE] display answer 86.67

Answer: Markup is 86.67

-------------------------------------------------
Program:

Program P8

MAR^-1 + .01: Ans^-1: Ans→MAR

Program P9

MAR^-1 - .01: Ans^-1
------------------------------------------------
Remark:

The MAR at the start of each program when enter use [RCL] [MAR]

The ^-1 is the (1/x) this model use [X^-1] the key located at the [SHIFT] [STO]
------------------------------------------------

Gamo 5/2021
Find all posts by this user
Quote this message in a reply
05-02-2021, 04:30 AM (This post was last modified: 05-03-2021 01:59 AM by Gamo.)
Post: #19
RE: Casio FC-200 Financial Consultant
Program P8 on previous post can be use as the [Tax -] or Tax Exclusive

[Tax -] is when price is already included tax or VAT and this function is to find

the price not include tax or VAT.

For Example:

This product you pay already included tax is 550 The Tax Rate is 20%
What is the price not include tax?

20 [MAR] [Prog] 8 [EXE] display 16.67 // set up the Tax Rate

550 [SEL] [COMP] [CST] [EXE] display 458.33 // Answer Price without Tax or VAT

To find the Tax Amount:

[RCL] [SEL] - [RCL] [CST] [EXE] display 91.67

-----------------------------------------------------------

You go to other place and got another product for 80
What is the price without tax or VAT?

While the Tax Rate data still in the memory go ahead and continue

80 [SEL] [COMP] [CST] 66.67

To find Tax Amount: [RCL] [SEL] [-] [RCL] [CST] [EXE] display 13.33

Remark:

This Pricing Calculation program can adapted to use for [Tax-] and [Tax+]
The "Tax Rate" have to convert and store to [MAR] by the use of the P8 program.
Use [CST] for [Tax-]
USE [SEL] for [Tax+]

Example:

To find Price with Tax: Price [CST] [COMP] [SEL] [EXE]

To find Price without Tax: Price [SEL] [COMP] [CST] [EXE]

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




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