Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CSCI 230 Assignment 05: Sinking Funds & Monthly Payments, Assignments of Computer Science

Instructions for assignment 05 in csci 230, fall-2006. Students are required to write a fortran program to compute monthly payments for a loan with given loan amount, annual interest rate, and number of years. The program should also compute the amounts of interest, principles, and balance for each month and for each year.

Typology: Assignments

Pre 2010

Uploaded on 08/18/2009

koofers-user-r9g
koofers-user-r9g 🇺🇸

5

(1)

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSCI 230 Assignment 05 Due: 10/12/06 (Thr)
Fall-2006 (100 pts)
Sinking Funds & Monthly Payments
Part I
(40 points)
Step 1. From the course web page (http://www.cs.niu.edu/~sjchung),
copy Prog05a.for and Prog05a.sjc into your f drive.
And, get printed copies of both files.
Step 2. Compile & link/edit your Prog05a.for to get Prog05a.obj and Prog05a.exe.
Step 3. Run your Prog05a.exe by:
h:\>Prog05a.exe > Prog05a.out
Your Prog05a.out should compare correctly to Prog05a.sjc.
Step 4. Study Prog05a.for and Prog05a.out.
Understanding them will help you do the problems
on Page 2 of this Assignment and write Prog05b.for.
Step 5. Complete the problems on Page 2 of this assignment.
Part II
(60 points)
Write a FORTRAN program that will prompt the user to enter Loan Amount (A),
Annual Rate (R) of interest, and Number (N) of years to finance the loan,
then compute the monthly payment (P) for the given A, R, and N.
In addition, your program will compute the amounts of interest, principles, and
balance for each month and for each year. The output by your program must display
the amounts for each month of the first year, followed by the annual reports.
Step 1. From the course web page (http://www.cs.niu.edu/~sjchung),
copy Prog05b.in and Prog05b.sjc into your H drive.
And, get printed copies of both files.
In case you need help, there is Prog05b.ref that you can use.
Step 2. Name your source program as Prog05b.for, and complete it.
Your Prog05b.for must be well structured, and must demonstrate
your knowledge on the use of FUNCTION and SUBROUTINE subprograms.
As always, your source program (Prog05b.for) must be well documented.
Step 3. Compile & link/edit your Prog05b.for to get Prog05b.obj and Prog05b.exe.
Step 4. Run your Prog05b.exe by: f:\>Prog05b < Prog05b.in | more
(to see the next page of the output, press the <Enter> key.)
Step 5. If the output shown on the screen (monitor) looks correct,
save the output as Prog05b.out by:
f:\>Prog05b < Prog05b.in > Prog05b.out
Your Prog05b.out should compare correctly to Prog05b.sjc.
1
pf3

Partial preview of the text

Download CSCI 230 Assignment 05: Sinking Funds & Monthly Payments and more Assignments Computer Science in PDF only on Docsity!

CSCI 230 Assignment 05 Due: 10/12/06 (Thr)

Fall-2006 (100 pts)

Sinking Funds & Monthly Payments

Part I (40 points) Step 1. From the course web page (http://www.cs.niu.edu/~sjchung), copy Prog05a.for and Prog05a.sjc into your f drive. And, get printed copies of both files. Step 2. Compile & link/edit your Prog05a.for to get Prog05a.obj and Prog05a.exe. Step 3. Run your Prog05a.exe by: h:> Prog05a.exe > Prog05a.out Your Prog05a.out should compare correctly to Prog05a.sjc. Step 4. Study Prog05a.for and Prog05a.out. Understanding them will help you do the problems on Page 2 of this Assignment and write Prog05b.for. Step 5. Complete the problems on Page 2 of this assignment. Part II (60 points) Write a FORTRAN program that will prompt the user to enter Loan Amount (A), Annual Rate (R) of interest, and Number (N) of years to finance the loan, then compute the monthly payment (P) for the given A, R, and N. In addition, your program will compute the amounts of interest, principles, and balance for each month and for each year. The output by your program must display the amounts for each month of the first year, followed by the annual reports. Step 1. From the course web page (http://www.cs.niu.edu/~sjchung), copy Prog05b.in and Prog05b.sjc into your H drive. And, get printed copies of both files. In case you need help, there is Prog05b.ref that you can use. Step 2. Name your source program as Prog05b.for, and complete it. Your Prog05b.for must be well structured, and must demonstrate your knowledge on the use of FUNCTION and SUBROUTINE subprograms. As always, your source program (Prog05b.for) must be well documented. Step 3. Compile & link/edit your Prog05b.for to get Prog05b.obj and Prog05b.exe. Step 4. Run your Prog05b.exe by: f:>Prog05b < Prog05b.in | more (to see the next page of the output, press the key.) Step 5. If the output shown on the screen (monitor) looks correct, save the output as Prog05b.out by: f:> Prog05b < Prog05b.in > Prog05b.out Your Prog05b.out should compare correctly to Prog05b.sjc.

Hand in :

  1. Page 2 of this Assignment
  2. Printed copies of your Prog05b.for and Prog05b.out
  3. Your 3.5" diskette containing your Prog05a.for, Prog05a.obj, Prog05a.exe, Prog05a.out, Prog05b.for, Prog05b.obj, Prog05b.exe, and Prog05b.out

CSCI 230 Due: 10/12/06 (Thr) Name:_______________,__________

Fall-2006 Assignment 05 (Last: spell it) (First)

If a loan of A dollars at an annual interest rate R is to be paid off in N years, and if the interests are compounded yearly, then the annual payment P is given by (see Ex.8, p.245): p = A(

R R

R

N N

  1. Given a loan of A dollars at an annual interest rate of R is to be paid off in N years, where the interests are compounded monthly, derive a formula for the monthly payment p to pay off the loan in N years:
  2. Rewrite the formula in Question 1 above, using Q where Q = (1.0 + R/12.0)12N (known as Amortization).
  3. Write a FUNCTION called Q(R,N) that receives two values for the arguments (called Aparameters@ in other programming languages) R and N, and computes: (1 + R/12.0)12N
  4. When the FUNCTION Q(R,N) is invoked (called) by x = Q(0.12,10), what value will be returned to x? (Feel free to use a calculator)
  5. Rewrite the formula for p in Question 2 above as a FORTRAN instruction, using (invoking) the FUNCTION Q(R,N).