Post Reply 
Programs for the Sharp EL-5500 III
05-13-2018, 10:22 AM
Post: #6
RE: Programs for the Sharp EL-5500 III
(05-11-2018 03:18 PM)Eddie W. Shore Wrote:  Net Present Value

Eddie, I do not understand how the NPV program is supposed to work. Please help me here, this is the code on your website:

4  CLEAR    // clears all the variables
6  INPUT “CF0:”; N, “RATE:”; I
8  J = 1
10 INPUT “FLOW:”; F, “FREQ:”; K
12 FOR L=1 TO K: N = N + F/(1 + I/100)^J: J = J+1
16 INPUT “MORE=1: “; L   // enter 1 to enter more cash flows, anything else to end entry
18 PRINT USING “#############.##”; “NPV: “; N
20 END

As far as I can tell the program will sum up the discounted first K cash flows in line 12/14. Then the user is prompted with "MORE" so that second, third etc. cash flow and its frequency can be entered. For another CF the user is supposed to enter "1", or anything else to quit. But look at line 16/18: the program does not process the user input L at all. Instead it prints the NPV (for the first CF only) and quits.

I'd say there is a line missing here:

17 IF L=1 GOTO 10

Or have I overlooked something here?

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

Messages In This Thread
RE: Programs for the Sharp EL-5500 III - Dieter - 05-13-2018 10:22 AM

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