Question: Write a Java program that reads an annual cash flow of 10 years and calculates net present value (NPV) of the 10-year cash flows. The
Write a Java program that reads an annual cash flow of 10 years and calculates net present value (NPV) of the 10-year cash flows. The program must read an interest rate to calculate the NPV.
Use loop statement(s) and array(s).
NPV = ((cash flow at year) / (1 + interest rate%)^1) + ((cash flow at year) / (1 + interest rate%)^2) + .......... ((cash flow at year) / (1 + interest rate%)^10)
Sample Inputs/ outputs:
Enter your annual cash flow:
100
Enter an interest rate:
0.01
NPV = 947.1305
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
