Programs for the Sharp EL-5500 III
05-13-2018, 10:22 AM
Post: #6
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
RE: Programs for the Sharp EL-5500 III
(05-11-2018 03:18 PM)Eddie W. Shore Wrote:  Net Present Value
...
https://edspi31415.blogspot.com/2018/05/...-2018.html

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

Code:
2  PAUSE “NET PRESEN VALUE” 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 14 NEXT L 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:

Code:
17 IF L=1 GOTO 10

Or have I overlooked something here?

Dieter
 « Next Oldest | Next Newest »

 Messages In This Thread Programs for the Sharp EL-5500 III - Eddie W. Shore - 01-16-2017, 04:26 PM RE: Programs for the Sharp EL-5500 III - Didier Lachieze - 01-16-2017, 07:47 PM RE: Programs for the Sharp EL-5500 III - toml_12953 - 05-13-2018, 03:13 PM RE: Programs for the Sharp EL-5500 III - Csaba Tizedes - 01-16-2017, 10:51 PM RE: Programs for the Sharp EL-5500 III - Eddie W. Shore - 05-11-2018, 03:18 PM RE: Programs for the Sharp EL-5500 III - Dieter - 05-13-2018 10:22 AM RE: Programs for the Sharp EL-5500 III - Dan - 05-13-2018, 05:20 AM RE: Programs for the Sharp EL-5500 III - Sylvain Cote - 05-13-2018, 11:01 AM RE: Programs for the Sharp EL-5500 III - Dan - 05-14-2018, 03:03 AM RE: Programs for the Sharp EL-5500 III - Didier Lachieze - 05-13-2018, 03:52 PM

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