Radio Shack TRS-80 PC-3 Owner's Manual page 187

Table of Contents

Advertisement

CHAPTER 9 PROGRAMMING EXAMPLES
This chapter presents a series of programming examples
whi;~
illustrate some of the potential programming capabilites of your
PC-3 Computer.
Each example is briefly discussed to indicate the logic and structure of the program and the way in which the
PC-3 Computer is being used.
This discussion is not meant to be a complete guide to programming. New programmers should
consult a separate book on how to program.
loan Payments
This program illustrates how the PC-3 Computer can be used to calculate the size of a loan payment and the total cost of the loan.
The program first solicits the amount borrowed, the rate of interest, and the number of months that the loan will run.
It then calculates the loan payment using this formula:
Where:
A is the monthly mortgage payment
P is the Principal; the amount borrowed
I is the interest for 1 month expressed as a decimal fraction (i.e., 1%
=
.(1)
N is the number of months
Then the program computes the total cost of the loan over the entire loan period and the total amount of interest.
The program asks for the interest for a whole year because this is the basis usually used to discuss interest.
187

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents