PD Parade
by George L. Smyth
Note: The program described in this column is available on this month's disk version or in the databases of the ST-LOG SIG on DELPHI.
George L. Smyth has a degree in psychology from West Virginia University and is currently employed as a programmer. He is the author of a series of tutorials on programming in FORTH.
As I was returning to Washington D.C. from Princeton, New Jersey last month, my car decided to expire. I was eventually able to coax it home, but when I checked the engine over, I realized that I needed to buy a new automobile.
I have never purchased a new car, and I wasn't sure how much I could afford. Then I remembered a public domain program, SAVELOAN, which would provide the financial answers I needed. (In my case, the answers were bad news. I decided that another roll of duct tape was more suited to my budget than a new car.)
Loaded as an accessory, SAVELOAN can be called from the desktop. Offered are 14 financial programs grouped in three categories: deposits, investments and loans. The left side of the screen displays the 14 routines, that are chosen with the mouse. When the choice is made, the right portion of the screen is blanked and the appropriate prompts are offered. The program I used was labeled "Principal" within the "Loans" section.
The prompts for this program include, "Regular payment," "Annual interest rate ( % )," "numbers of payments per year," "numbers of years" and "numbers of payments made in last year." My input to these were 160, 10, 12, 3 and 0, respectively, assuming the ability to pay $160 per month for three years at an interest rate of 10%. When the last prompt was answered, the calculation from these values was displayed at the bottom: Principal = $4,95R55. (Not much of a car.)
You can modify any of the values using the arrow keys to position the cursor beside the prompt to be altered. The delete or backspace key is used to erase the previous entry, after which the new value can be entered. The two methods of obtaining, in this case, the new principal amount is to either press the Return key until the last prompt is passed or press the F8 function key. F8 recalculates the expression and displays the corrected value in place of the original answer. Changing the number of years from three to four yields a principal of $6,308.45, so that extra year will allow the purchase of a car costing about $1,350 more.
Results can be compared against each other by constantly editing a certain value. For instance, the user may wish to continually change the amount of the payments so that a variety of principals may be obtained. For this reason, sending the entered values and computed sum to a printer becomes useful. (The printer function is performed by pressing the F7 key.) Because the output is straight text there should be no printer compatibility problems.
The routine names are as descriptive as possible, but it's easy to forget which program provides what calculation. Luckily, clicking within a routine's description box will display the associated prompts. This may be done at any time: before, after or while entering values.
The "Deposits" section offers two programs. One routine determines the future value of regular deposits, while the other calculates how much should be regularly deposited to obtain a certain value. It can be an eye-opener to see what a few dollars saved in an orderly manner will yield in just a few years. If paying for college is in your future, this program can give you a real shock.
The "Investments" portion contains routines which determine the future value of an investment, the initial amount needed to be compounded to yield a future value and the amount of regular withdrawals that can be periodically drawn from an initial investment, as well as others. Determining the advantages of differing term and percentage CDs can be done by swapping results back and forth between programs. Since the entered values and results can be sent to the printer for comparison, understanding the tangible differences between all of the bank options is made more palatable.
Most of us will find the "Loans" area to be of greatest interest (no pun intended). Routines to calculate the principal on a loan, the regular payments needed to pay off a principal amount, the annual interest rate on a loan and the remaining balance on a loan will be most often used. When paying off a loan, you don't always have to send the exact amount on the payment stub; you may pay more. It is interesting to use this program to note the amount of money to be saved by increasing payment of a loan by only 10%, considerably less than the total of the remaining stubs.
If you find yourself stuck whenever you try to figure any of the above calculations, it would be difficult to beat SAVELOAN. Save this program. You never know: You might be needing a new car soon.